elm/exercises/grains/Grains.example.elm

10 lines
138 B
Elm
Raw Normal View History

2016-12-25 10:57:15 +01:00
module Grains exposing (..)
square : Int -> Maybe Int
square n =
if n < 1 then
Nothing
else
Just <| 2 ^ (n - 1)