
26 Jul
2004
26 Jul
'04
1:10 p.m.
Hi
I'm not especially experienced in using haskell, and I could use some help.
As part of a project, I'm trying to construct a data type that can represent three values as a 'triple' (as opposed to a 'tuple'), and then make a function so that I can sort these values into ascending order.
I'm having a few problems with the code that I have at the minute (I suspect its riddled with errors!)
type Triple = Triple {
entry 1 :: a;
entry 2 :: a;
entry 3 :: a;
sortTriple :: Triple a -> Triple a;
} deriving (Show, Eq)
where
sortTriple t@(Triple x y z)
| (y