[<<][meta][>>][..]
Sun Oct 23 15:37:44 EDT 2011

Primtiive type stuff

class TMLprim t where primType :: t -> TypeName
instance TMLprim Tbool   where primType _ = ABool
instance TMLprim Tint    where primType _ = AInt
instance TMLprim Tfloat  where primType _ = AFloat

class TypeOf t where typeOf :: t -> TypeName
instance TMLprim t => TypeOf (Code t) where
  typeOf (Code t) = primType t


of course that last instance won't work, but this does:

class TypeOf t where typeOf :: t -> TypeName
instance TMLprim t => TypeOf (Code t) where
  typeOf _ = primType (undefined :: t)




[Reply][About]
[<<][meta][>>][..]