diff options
Diffstat (limited to 'src/Grasp/Types/Instruction.hs')
-rw-r--r-- | src/Grasp/Types/Instruction.hs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Grasp/Types/Instruction.hs b/src/Grasp/Types/Instruction.hs new file mode 100644 index 0000000..0ff4002 --- /dev/null +++ b/src/Grasp/Types/Instruction.hs @@ -0,0 +1,32 @@ +module Grasp.Types.Instruction ( + Instruction, + + mk, + + toString, + toFloat + ) where + + + + +import Text.Read( readMaybe ) + + + + +newtype Instruction = Instruction String + deriving (Show, Eq) + + + + +mk :: String -> Instruction +mk = Instruction + +toString :: Instruction -> String +toString (Instruction i) = i + +toFloat :: Instruction -> Maybe Float +toFloat (Instruction i) = readMaybe i + |