[Haskell-beginners] Constructor classes and type classes.

Imants Cekusins imantc at gmail.com
Thu Nov 3 18:05:10 UTC 2016


this builds. not sure if the instances are as intended


{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
module SetClass where

data TimeFacts t = Bef (t, t, TimeFacts t) | New

class SetClass t  where
class SetClass t => Time l t  where
class Time l t => TimeE l t where
class Time l t => TimeTO l t where


instance SetClass (TimeFacts t) where -- OK
instance (SetClass t) => Time (TimeFacts t) t where
instance (SetClass t) => TimeE (TimeFacts t) t where
instance (SetClass t) => TimeTO (TimeFacts t) t where

​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20161103/cb290551/attachment.html>


More information about the Beginners mailing list