author | haftmann |
Thu, 04 Jan 2007 17:17:48 +0100 | |
changeset 21994 | dfa5133dbe73 |
parent 21993 | 4b802a9e0738 |
child 22015 | 12b94d7f7e1f |
permissions | -rw-r--r-- |
21147 | 1 |
module Codegen where |
21189 | 2 |
import qualified Nat |
21147 | 3 |
|
4 |
class Null a where |
|
21993 | 5 |
nulla :: a |
21147 | 6 |
|
21993 | 7 |
heada :: (Codegen.Null a) => ([a] -> a) |
8 |
heada (y : xs) = y |
|
21994 | 9 |
heada [] = Codegen.nulla |
21147 | 10 |
|
11 |
null_option :: Maybe b |
|
12 |
null_option = Nothing |
|
13 |
||
14 |
instance Codegen.Null (Maybe b) where |
|
15 |
null = Codegen.null_option |
|
16 |
||
21189 | 17 |
dummy :: Maybe Nat.Nat |
21993 | 18 |
dummy = Codegen.heada [Just (Nat.Suc Nat.Zero_nat), Nothing] |