| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Curly.Core.Types
- data TypeClass s
 - data NativeType
 - data TypeShape s
- = TypeCons (TypeClass s)
 - | NativeType NativeType
 - | PolyType
 - | SkolemType Int
 - | TypeMismatch (TypeShape s) (TypeShape s)
 - | HiddenTypeError
 
 - data TypeIndex s = TypeIndex (TypeClass s) Int
 - pattern In :: forall t. TypeIndex t
 - pattern Out :: forall t. TypeIndex t
 - data PathRoot
 - type TypePath s = (PathRoot, [TypeIndex s])
 - t'ImplicitRoot :: Traversal' PathRoot Int
 - t'ContextRoot :: Traversal' PathRoot Int
 - newtype Type s = Type (Equiv (TypeShape s) (TypePath s))
 - argumentType :: Ord s => Int -> Type s
 - builtinType :: forall s. Identifier s => Builtin -> Type s
 - rigidTypeFun :: Ord s => String -> Type s
 - typeConstraints :: Ord s => Type s -> ([(s, [Set Int])], [(s, [Set Int])])
 - extractFirstArgument :: Identifier s => Type s -> Type s
 - mapTypePaths :: Ord s => (TypePath s -> Maybe (TypePath s)) -> Type s -> Type s
 - mapTypePathsMonotonic :: Ord s => (TypePath s -> Maybe (TypePath s)) -> Type s -> Type s
 - traverseTypeShapes :: (Ord s, Monad m) => ([TypePath s] -> TypeShape s -> m (TypeShape s)) -> Type s -> m (Type s)
 - mapTypeShapes :: Ord s => ([TypePath s] -> TypeShape s -> TypeShape s) -> Type s -> Type s
 - selectConstraints :: Ord s => (Int -> Maybe Int) -> (Int -> Maybe Int) -> Type s -> Type s
 - clearContexts :: Ord s => Type s -> Type s
 - abstractStructTypes :: Ord s => s -> [String] -> [String] -> Type s -> (Type s, Type s)
 - abstractImplicitType :: Ord s => (s, [Set Int]) -> [String] -> Type s -> Type s
 - functionFrom :: Ord s => Int -> Type s -> Type s
 - freezeType :: Ord s => Type s -> Type s
 - thawType :: Ord s => Type s -> Type s
 - isComplexType :: Ord s => Type s -> Bool
 - compareConstrainedness :: Identifier s => Type s -> Type s -> Maybe Ordering
 - isSubtypeOf :: Identifier s => Type s -> Type s -> Bool
 - constraintType :: Ord s => s -> Int -> Type s
 - data InstanceMap s a
 - isValidInstanceMap :: Identifier s => InstanceMap s a -> Bool
 
Type constructors
Instances
| HasIdents s s' (TypeClass s) (TypeClass s') Source # | |
| Serializable Bytes s => Serializable Bytes (TypeClass s) Source # | |
| Format Bytes s => Format Bytes (TypeClass s) Source # | |
| Eq s => Eq (TypeClass s) Source # | |
| Ord s => Ord (TypeClass s) Source # | |
| Identifier s => Show (TypeClass s) Source # | |
| Generic (TypeClass s) Source # | |
| NFData s => NFData (TypeClass s) Source # | |
| type Rep (TypeClass s) Source # | |
data NativeType Source #
Instances
The shape of a Curly type
Constructors
| TypeCons (TypeClass s) | |
| NativeType NativeType | |
| PolyType | |
| SkolemType Int | |
| TypeMismatch (TypeShape s) (TypeShape s) | |
| HiddenTypeError | 
Instances
| Ord s' => HasIdents s s' (TypeShape s) (TypeShape s') Source # | |
| Serializable Bytes s => Serializable Bytes (TypeShape s) Source # | |
| (Format Bytes s, Ord s) => Format Bytes (TypeShape s) Source # | |
| Eq s => Eq (TypeShape s) Source # | |
| Ord s => Ord (TypeShape s) Source # | |
| Identifier s => Show (TypeShape s) Source # | |
| Generic (TypeShape s) Source # | |
| NFData s => NFData (TypeShape s) Source # | |
| Ord s => Semigroup (TypeShape s) Source # | |
| Ord s => Monoid (TypeShape s) Source # | |
| type Rep (TypeShape s) Source # | |
Type paths
An index into a type
Instances
| HasIdents s s' (TypeIndex s) (TypeIndex s') Source # | |
| Serializable Bytes s => Serializable Bytes (TypeIndex s) Source # | |
| Format Bytes s => Format Bytes (TypeIndex s) Source # | |
| Eq s => Eq (TypeIndex s) Source # | |
| Ord s => Ord (TypeIndex s) Source # | |
| Identifier s => Show (TypeIndex s) Source # | |
| Generic (TypeIndex s) Source # | |
| NFData s => NFData (TypeIndex s) Source # | |
| type Rep (TypeIndex s) Source # | |
The path of a node inside a type.
A path is comprised of two parts : a canonical path, which uniquely identifies the node within its type graph; and a set of equivalent paths that are shared between all types.
Constructors
| ArgumentRoot Int | |
| TypeRoot | |
| ImplicitRoot Int | |
| ContextRoot Int | |
| NamedRoot String | 
Types
A Curly type.
A Curly type may be understood as a (possibly infinite) set of constraints over its graph ("the node A must be a function", "the output of B must be an Int", ...).
In that sense, Curly types are monoids by isomorphism with the set
monoid (C(a+b)=C(a)+C(b) where C(a) is the constraint set of the
type a). This monoid instance is used to perform type inference by
unifying constraints on the appropriate types.
Instances
| (Ord s, Ord s') => HasIdents s s' (Type s) (Type s') Source # | |
| (Ord s, Serializable Bytes s) => Serializable Bytes (Type s) Source # | |
| (Ord s, Format Bytes s) => Format Bytes (Type s) Source # | |
| Identifier s => Eq (Type s) Source # | |
| Identifier s => Ord (Type s) Source # | |
| Identifier s => Show (Type s) Source # | |
| Generic (Type s) Source # | |
| NFData s => NFData (Type s) Source # | |
| Identifier s => Semigroup (Type s) Source # | |
| Identifier s => Monoid (Type s) Source # | |
| Identifier s => Documented (Type s) Source # | |
| Identifier s => OrderedMap (InstanceMap s a) (s, Type s) a Source # | |
| Identifier s => DataMap (InstanceMap s a) (s, Set Int, Type s) a Source # | |
| type Rep (Type s) Source # | |
builtinType :: forall s. Identifier s => Builtin -> Type s Source #
extractFirstArgument :: Identifier s => Type s -> Type s Source #
traverseTypeShapes :: (Ord s, Monad m) => ([TypePath s] -> TypeShape s -> m (TypeShape s)) -> Type s -> m (Type s) Source #
abstractStructTypes :: Ord s => s -> [String] -> [String] -> Type s -> (Type s, Type s) Source #
Create a pair of constructor/destructor types
compareConstrainedness :: Identifier s => Type s -> Type s -> Maybe Ordering Source #
isSubtypeOf :: Identifier s => Type s -> Type s -> Bool Source #
Implicit instances
data InstanceMap s a Source #
Instances
| (Identifier s, Identifier s') => HasIdents s s' (InstanceMap s a) (InstanceMap s' a) Source # | |
| (Identifier s, Serializable Bytes s, Serializable Bytes a) => Serializable Bytes (InstanceMap s a) Source # | |
| (Identifier s, Format Bytes s, Format Bytes a) => Format Bytes (InstanceMap s a) Source # | |
| Functor (InstanceMap s) Source # | |
| Foldable (InstanceMap s) Source # | |
| Identifier s => Traversable (InstanceMap s) Source # | |
| (Eq a, Identifier s) => Eq (InstanceMap s a) Source # | |
| (Ord a, Identifier s) => Ord (InstanceMap s a) Source # | |
| Generic (InstanceMap s a) Source # | |
| Ord s => Semigroup (InstanceMap s a) Source # | |
| Ord s => Monoid (InstanceMap s a) Source # | |
| Identifier s => OrderedMap (InstanceMap s a) (s, Type s) a Source # | |
| Identifier s => DataMap (InstanceMap s a) (s, Set Int, Type s) a Source # | |
| type Rep (InstanceMap s a) Source # | |
isValidInstanceMap :: Identifier s => InstanceMap s a -> Bool Source #