summaryrefslogtreecommitdiff
path: root/src/Grasp/Types/Instruction.hs
blob: e618222976385877e4183a4bf2940edf130f184d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
module Grasp.Types.Instruction (
	Instruction,

	mk,

	toString,
	toFloat,
	toInt
    ) 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

toInt :: Instruction -> Maybe Int
toInt (Instruction i) = readMaybe i