author | haftmann |
Tue, 18 Sep 2007 10:44:02 +0200 | |
changeset 24628 | 33137422d7fd |
parent 24421 | acfb2413faa3 |
child 25056 | 743f3603ba8b |
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 |
||
22798 | 9 |
heada :: (Codegen.Null b) => [b] -> b; |
22751 | 10 |
heada (x : xs) = x; |
22015 | 11 |
heada [] = Codegen.nulla; |
21147 | 12 |
|
24628 | 13 |
instance Codegen.Null (Maybe a) where { |
24421 | 14 |
nulla = Nothing; |
22015 | 15 |
}; |
21147 | 16 |
|
22015 | 17 |
dummy :: Maybe Nat.Nat; |
18 |
dummy = Codegen.heada [Just (Nat.Suc Nat.Zero_nat), Nothing]; |
|
21147 | 19 |
|
22015 | 20 |
} |