implemented newAbacus
This commit is contained in:
@@ -28,13 +28,16 @@ module Abacus (Abacus, newAbacus) where
|
||||
|
||||
import Abacus.Internal
|
||||
|
||||
-- | Constructs the initial state of a new "Abacus"
|
||||
-- | Constructs the initial state of a new "Abacus"; will return
|
||||
-- "Nothing" if the input paramebers are invalid.
|
||||
newAbacus
|
||||
:: Int
|
||||
-- ^ The number of beads on each rung
|
||||
-- ^ The number of beads on each rung (must be at least one)
|
||||
-> Int
|
||||
-- ^ The number of rungs
|
||||
-- ^ The number of rungs (must be at least one)
|
||||
-> Maybe Abacus
|
||||
newAbacus = undefined
|
||||
newAbacus beads rungs = if beads < 1 || rungs < 1
|
||||
then Nothing
|
||||
else Just $ Abacus beads $ replicate rungs 0
|
||||
|
||||
--jl
|
||||
|
||||
Reference in New Issue
Block a user