author | haftmann |
Fri, 05 Jan 2007 14:31:44 +0100 | |
changeset 22015 | 12b94d7f7e1f |
parent 21994 | dfa5133dbe73 |
child 22188 | a63889770d57 |
permissions | -rw-r--r-- |
22015 | 1 |
module Codegen where { |
2 |
||
3 |
import qualified Nat; |
|
21147 | 4 |
|
22015 | 5 |
class Null a where { |
6 |
nulla :: a; |
|
7 |
}; |
|
8 |
||
9 |
heada :: (Codegen.Null a) => [a] -> a; |
|
10 |
heada (y : xs) = y; |
|
11 |
heada [] = Codegen.nulla; |
|
21147 | 12 |
|
22015 | 13 |
null_option :: Maybe b; |
14 |
null_option = Nothing; |
|
21147 | 15 |
|
22015 | 16 |
instance Codegen.Null (Maybe b) where { |
17 |
nulla = Codegen.null_option; |
|
18 |
}; |
|
21147 | 19 |
|
22015 | 20 |
dummy :: Maybe Nat.Nat; |
21 |
dummy = Codegen.heada [Just (Nat.Suc Nat.Zero_nat), Nothing]; |
|
21147 | 22 |
|
22015 | 23 |
} |