All pastes #178998 Raw Edit

russo

public text v1 · immutable
#178998 ·published 2006-09-21 20:12 UTC
rendered paste body
data Val = A | B | C | D

instance Show Val where
        show A = "Alpha"
        show B = "Beta"
        show C = "Charlie"
        show D = "Delta"

instance Show Lis where
        show (K x y) = "(K " ++ show x ++ " " ++ show y ++")"
        show (Konez) = "Konez"
data Lis = K Val Lis | Konez

fst :: Lis -> Val

fst (K x y) = x

zip :: Lis -> Lis -> Lis

zip (Konez) (K a b) = (K a b)
zip (K x y) (Konez) = (K x y)
zip (K x y) v = (K x (zip y v)) -- Here i want it to zip y v until y==Konez