-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Lightweight strict types -- -- Lightweight, zero-cost strict versions of basic data types @package strict-wrapper @version 0.0.0.0 module Data.Strict.Wrapper -- | Use the Strict pattern if you want to subsequently match on -- the t it contains (otherwise it is more efficient to use -- strict). -- --
-- printIt :: Strict (Maybe Int) -> IO () -- printIt (Strict (Just i)) = print i -- printIt (Strict Nothing) = putStrLn "Nothing there" ---- -- Make a Strict t using the Strict constructor if you -- are constructing it from its individual fields (otherwise it is more -- efficient to use unstrict). -- --
-- makeStrict :: Int -> Strict (Int, String) -- makeStrict i = Strict (i + 1, show i) --pattern Strict :: Strictly t => t -> Strict t -- | Isomorphic to the type t, except that when it is evaulated -- its immediate children are evaluated too. data family Strict t -- | Make a Strict t using strict if you obtained a whole -- t from elsewhere (otherwise, if you have the components of -- t separately, then it is more efficient to use the -- Strict constructor instead). -- --
-- makeStrict :: (Int, Strict (Int, String)) -> Int -- makeStrict (i, s) = i + f (strict s) --strict :: Strictly t => t -> Strict t -- | Access the contents of a Strict t, but not its fields, using -- unstrict (if you want access to the fields then it is more -- efficient to use the Strict pattern). -- --
-- strictMaybe :: r -> (a -> r) -> Strict (Maybe a) -> r -- strictMaybe r f sm = maybe r f (unstrict sm) --unstrict :: Strictly t => Strict t -> t -- | A type t can be given a Strictly instance when it -- has a very cheap conversion to and from a strict type, Strict -- t. class Strictly t -- | Used to implement the Strict pattern synonym. You should never -- need to use matchStrict unless you are defining your own -- instance of Strictly. matchStrict :: Strictly t => Strict t -> t -- | Used to implement the Strict constructor. You should never need -- to use constructStrict unless you are defining your own -- instance of Strictly. constructStrict :: Strictly t => t -> Strict t -- | Some data types, such as Int and Double, are already as -- strict as they can be. There is no need to wrap them in Strict! type family AlreadyStrict t :: Constraint -- | Some data types, such as [a], can't be made strict in a -- zero-cost way. type family CannotBeStrict t :: Constraint -- | It is redundant to nest Strict, e.g. Strict (Strict (t1, -- t2)). Just use one layer of Strict. type family NestedStrict t :: Constraint -- | Some Strictly instances are not yet implemented. Please file an -- issue if you need them. type family NotYetImplemented t :: Constraint instance Data.Strict.Wrapper.NestedStrict t => Data.Strict.Wrapper.Strictly (Data.Strict.Wrapper.Strict t) instance Data.Strict.Wrapper.NotYetImplemented (x1, x2, x3, x4, x5) => Data.Strict.Wrapper.Strictly (x1, x2, x3, x4, x5) instance Data.Strict.Wrapper.NotYetImplemented (x1, x2, x3, x4, x5, x6) => Data.Strict.Wrapper.Strictly (x1, x2, x3, x4, x5, x6) instance Data.Strict.Wrapper.CannotBeStrict [t] => Data.Strict.Wrapper.Strictly [t] instance Data.Strict.Wrapper.CannotBeStrict (GHC.Types.IO a) => Data.Strict.Wrapper.Strictly (GHC.Types.IO a) instance Data.Strict.Wrapper.AlreadyStrict () => Data.Strict.Wrapper.Strictly () instance Data.Strict.Wrapper.AlreadyStrict GHC.Types.Bool => Data.Strict.Wrapper.Strictly GHC.Types.Bool instance Data.Strict.Wrapper.AlreadyStrict GHC.Types.Int => Data.Strict.Wrapper.Strictly GHC.Types.Int instance Data.Strict.Wrapper.AlreadyStrict GHC.Integer.Type.Integer => Data.Strict.Wrapper.Strictly GHC.Integer.Type.Integer instance Data.Strict.Wrapper.AlreadyStrict GHC.Types.Float => Data.Strict.Wrapper.Strictly GHC.Types.Float instance Data.Strict.Wrapper.AlreadyStrict GHC.Types.Double => Data.Strict.Wrapper.Strictly GHC.Types.Double instance Data.Strict.Wrapper.AlreadyStrict GHC.Types.Word => Data.Strict.Wrapper.Strictly GHC.Types.Word instance Data.Strict.Wrapper.AlreadyStrict GHC.Types.Ordering => Data.Strict.Wrapper.Strictly GHC.Types.Ordering instance Data.Strict.Wrapper.AlreadyStrict GHC.Types.Char => Data.Strict.Wrapper.Strictly GHC.Types.Char instance Data.Strict.Wrapper.Strictly (t1, t2) instance Data.Strict.Wrapper.Strictly (t1, t2, t3) instance Data.Strict.Wrapper.Strictly (t1, t2, t3, t4) instance Data.Strict.Wrapper.Strictly (GHC.Maybe.Maybe t) instance Data.Strict.Wrapper.Strictly (Data.Either.Either t1 t2)