subhask-0.1.0.1: Type safe interface for programming in subcategories of Hask

Safe HaskellNone
LanguageHaskell2010

SubHask.TemplateHaskell.Mutable

Description

Template Haskell functions for deriving Mutable instances.

Synopsis

Documentation

mkMutable :: Q Type -> Q [Dec] Source

Inspects the given type and creates the most efficient Mutable instance possible.

FIXME: implement properly

mkMutablePrimRef :: Q Type -> Q [Dec] Source

Create a Mutable instance that uses PrimRefs for the underlying implementation. This method will succeed for all types. But certain types can be implemented for efficiently.

mkMutableNewtype :: Name -> Q [Dec] Source

Create a Mutable instance for newtype wrappers. The instance has the form:

newtype instance Mutable m (TyCon t) = Mutable_TyCon (Mutable m t)

Also create the appropriate IsMutable instance.

FIXME: Currently uses default implementations which are slow.