-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Overloaded pragmas as a plugin -- -- Implement Overloaded pragmas as a source plugin -- -- For example we can replace -- --
-- {-# LANGUAGE OverloadedStrings #-}
--
--
-- with
--
--
-- {-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:Strings #-}
--
@package overloaded
@version 0.2
-- | Overloaded characters.
module Overloaded.Chars
-- | Class for Char-like datastructures
--
-- A character literal x is desugared to
--
-- -- fromChar 'x' --class FromChar a fromChar :: FromChar a => Char -> a instance Overloaded.Chars.FromChar GHC.Types.Char -- | Overloaded if-expression. module Overloaded.If -- | Class for Bool-like datastrucutres -- -- An if--expression if b then t else e is desugared to -- --
-- ifte (toBool b) t e ---- -- Enabled with: -- --
-- {-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:If #-}
--
class ToBool b
toBool :: ToBool b => b -> Bool
-- | ToBool overloaded if-expression.
ifte :: ToBool b => b -> a -> a -> a
instance Overloaded.If.ToBool GHC.Types.Bool
instance Overloaded.If.ToBool (GHC.Maybe.Maybe a)
instance Overloaded.If.ToBool (Data.Either.Either b a)
-- | Another way to desugar overloaded list literals. See Nil and
-- Cons.
--
-- An explicit list expression, e.g. [1, True] is desugared to
--
-- -- cons 1 (cons True nil) ---- -- Enabled with: -- --
-- {-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:Lists #-}
--
module Overloaded.Lists
-- | Class for nil, []
--
-- See test-suite for ways to define instances for Map. There are
-- at-least two-ways.
class Nil a
nil :: Nil a => a
-- | Class for Cons :.
class Cons x ys zs | zs -> x ys
cons :: Cons x ys zs => x -> ys -> zs
infixr 5 `cons`
fromList :: (Nil xs, Cons x xs xs) => [x] -> xs
instance (a Data.Type.Equality.~ b, b Data.Type.Equality.~ c) => Overloaded.Lists.Cons a [b] [c]
instance (a Data.Type.Equality.~ b, b Data.Type.Equality.~ c) => Overloaded.Lists.Cons a [b] (GHC.Base.NonEmpty c)
instance (GHC.Classes.Ord a, a Data.Type.Equality.~ b, b Data.Type.Equality.~ c) => Overloaded.Lists.Cons a (Data.Set.Internal.Set b) (Data.Set.Internal.Set c)
instance Overloaded.Lists.Cons GHC.Types.Int Data.IntSet.Internal.IntSet Data.IntSet.Internal.IntSet
instance (a Data.Type.Equality.~ b, b Data.Type.Equality.~ c) => Overloaded.Lists.Cons a (Data.Sequence.Internal.Seq b) (Data.Sequence.Internal.Seq c)
instance (GHC.Classes.Ord k, k Data.Type.Equality.~ k1, k Data.Type.Equality.~ k2, v Data.Type.Equality.~ v1, v Data.Type.Equality.~ v2) => Overloaded.Lists.Cons (k, v) (Data.Map.Internal.Map k1 v1) (Data.Map.Internal.Map k2 v2)
instance (i Data.Type.Equality.~ GHC.Types.Int, a Data.Type.Equality.~ b, b Data.Type.Equality.~ c) => Overloaded.Lists.Cons (i, a) (Data.IntMap.Internal.IntMap b) (Data.IntMap.Internal.IntMap c)
instance (a Data.Type.Equality.~ b, b Data.Type.Equality.~ c, m Data.Type.Equality.~ 'Data.Nat.S n) => Overloaded.Lists.Cons a (Data.Vec.Lazy.Vec n b) (Data.Vec.Lazy.Vec m c)
instance forall k (f :: k -> *) (g :: k -> *) (h :: k -> *) (xxs :: [k]) (x :: k) (xs :: [k]). (f Data.Type.Equality.~ g, g Data.Type.Equality.~ h, xxs Data.Type.Equality.~ (x : xs)) => Overloaded.Lists.Cons (f x) (Data.SOP.NP.NP g xs) (Data.SOP.NP.NP h xxs)
instance forall k (f :: k -> *) (g :: k -> *) (h :: k -> *) (xsxss :: [[k]]) (xs :: [k]) (xss :: [[k]]). (f Data.Type.Equality.~ g, g Data.Type.Equality.~ h, xsxss Data.Type.Equality.~ (xs : xss)) => Overloaded.Lists.Cons (Data.SOP.NP.NP f xs) (Data.SOP.NP.POP g xss) (Data.SOP.NP.POP h xsxss)
instance (a Data.Type.Equality.~ b, a Data.Type.Equality.~ c) => Overloaded.Lists.Cons a (Data.RAList.Internal.RAList b) (Data.RAList.Internal.RAList c)
instance (a Data.Type.Equality.~ b, a Data.Type.Equality.~ c) => Overloaded.Lists.Cons a (Data.RAList.Internal.RAList b) (Data.RAList.NonEmpty.Internal.NERAList c)
instance (b Data.Type.Equality.~ 'Data.Bin.BP bb, bp Data.Type.Equality.~ Data.Type.Bin.Pred bb, bb Data.Type.Equality.~ Data.Type.Bin.Succ' bp) => Overloaded.Lists.Cons a (Data.RAVec.RAVec bp a) (Data.RAVec.RAVec b a)
instance (bp Data.Type.Equality.~ Data.Type.Bin.Pred b, b Data.Type.Equality.~ Data.Type.Bin.Succ' bp) => Overloaded.Lists.Cons a (Data.RAVec.RAVec bp a) (Data.RAVec.NonEmpty.NERAVec b a)
instance Overloaded.Lists.Nil [a]
instance Overloaded.Lists.Nil (Data.Set.Internal.Set a)
instance Overloaded.Lists.Nil Data.IntSet.Internal.IntSet
instance Overloaded.Lists.Nil (Data.Sequence.Internal.Seq a)
instance Overloaded.Lists.Nil (Data.Map.Internal.Map k v)
instance Overloaded.Lists.Nil (Data.IntMap.Internal.IntMap v)
instance (n Data.Type.Equality.~ 'Data.Nat.Z) => Overloaded.Lists.Nil (Data.Vec.Lazy.Vec n a)
instance forall k (xs :: [k]) (f :: k -> *). (xs Data.Type.Equality.~ '[]) => Overloaded.Lists.Nil (Data.SOP.NP.NP f xs)
instance forall k (xs :: [[k]]) (f :: k -> *). (xs Data.Type.Equality.~ '[]) => Overloaded.Lists.Nil (Data.SOP.NP.POP f xs)
instance Overloaded.Lists.Nil (Data.RAList.Internal.RAList a)
instance (b Data.Type.Equality.~ 'Data.Bin.BZ) => Overloaded.Lists.Nil (Data.RAVec.RAVec b a)
-- | Another way to desugar list literals.
--
-- An explicit list expression, e.g. [1, True] is desugared to
--
-- -- cons 1 (cons True nil) ---- -- This desugaring uses bidirectional functional dependencies to make -- cons infer more. The trade-off is that we can have strictly -- less instances. -- -- Enabled with: -- --
-- {-# OPTIONS_GHC -fplugin=Overloaded
-- -fplugin-opt=Overloaded:Lists=Overloaded.Lists.Bidi.nil=Overloaded.Lists.Bidi.cons
--
module Overloaded.Lists.Bidi
nil :: Nil a => a
-- | Bidirectional class for Cons :.
class Cons x ys zs => Cons x ys zs | zs -> x ys, x ys -> zs
cons :: Cons x ys zs => x -> ys -> zs
infixr 5 `cons`
fromList :: (Nil xs, Cons x xs xs) => [x] -> xs
instance (a Data.Type.Equality.~ b, b Data.Type.Equality.~ c) => Overloaded.Lists.Bidi.Cons a [b] [c]
instance (GHC.Classes.Ord a, a Data.Type.Equality.~ b, b Data.Type.Equality.~ c) => Overloaded.Lists.Bidi.Cons a (Data.Set.Internal.Set a) (Data.Set.Internal.Set a)
instance Overloaded.Lists.Bidi.Cons GHC.Types.Int Data.IntSet.Internal.IntSet Data.IntSet.Internal.IntSet
instance (a Data.Type.Equality.~ b, b Data.Type.Equality.~ c) => Overloaded.Lists.Bidi.Cons a (Data.Sequence.Internal.Seq b) (Data.Sequence.Internal.Seq c)
instance (GHC.Classes.Ord k, k Data.Type.Equality.~ k1, k Data.Type.Equality.~ k2, v Data.Type.Equality.~ v1, v Data.Type.Equality.~ v2) => Overloaded.Lists.Bidi.Cons (k, v) (Data.Map.Internal.Map k1 v1) (Data.Map.Internal.Map k2 v2)
instance (i Data.Type.Equality.~ GHC.Types.Int, a Data.Type.Equality.~ b, b Data.Type.Equality.~ c) => Overloaded.Lists.Bidi.Cons (i, a) (Data.IntMap.Internal.IntMap b) (Data.IntMap.Internal.IntMap c)
instance (a Data.Type.Equality.~ b, b Data.Type.Equality.~ c, m Data.Type.Equality.~ 'Data.Nat.S n) => Overloaded.Lists.Bidi.Cons a (Data.Vec.Lazy.Vec n b) (Data.Vec.Lazy.Vec m c)
instance forall k (f :: k -> *) (g :: k -> *) (h :: k -> *) (xxs :: [k]) (x :: k) (xs :: [k]). (f Data.Type.Equality.~ g, g Data.Type.Equality.~ h, xxs Data.Type.Equality.~ (x : xs)) => Overloaded.Lists.Bidi.Cons (f x) (Data.SOP.NP.NP g xs) (Data.SOP.NP.NP h xxs)
instance forall k (f :: k -> *) (g :: k -> *) (h :: k -> *) (xsxss :: [[k]]) (xs :: [k]) (xss :: [[k]]). (f Data.Type.Equality.~ g, g Data.Type.Equality.~ h, xsxss Data.Type.Equality.~ (xs : xss)) => Overloaded.Lists.Bidi.Cons (Data.SOP.NP.NP f xs) (Data.SOP.NP.POP g xss) (Data.SOP.NP.POP h xsxss)
-- | Overloaded natural numbers.
module Overloaded.Naturals
-- | Class for Natural-like datastructures
--
-- A numeric literal 42 is desugared to
--
-- -- fromNatural 42 --class FromNatural a fromNatural :: FromNatural a => Natural -> a instance Overloaded.Naturals.FromNatural GHC.Natural.Natural instance Overloaded.Naturals.FromNatural GHC.Integer.Type.Integer -- | Another way to desugar overloaded numeric literals. See -- FromNumeral. module Overloaded.Numerals -- | Another way to desugar numerals. -- -- A numeric literal 123 is desugared to -- --
-- fromNumeral @123 ---- -- Enabled with: -- --
-- {-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:Numerals #-}
--
--
-- One can do type-level computations with this.
class FromNumeral (n :: Nat) a
fromNumeral :: FromNumeral n a => a
-- | Default implementation of fromNumeral.
--
-- Usage example:
--
-- -- instance (KnownNat n, ...) => FromNumeral n MyType where -- fromNumeral = defaultFromNumeral @n --defaultFromNumeral :: forall n a. (KnownNat n, Integral a) => a instance Data.Type.BinP.SBinPI b => Overloaded.Numerals.PosFromNumeral 'Data.Nat.Z b instance (Data.Type.BinP.SBinPI bp, Overloaded.Numerals.PosFromNumeral n bp, Data.Type.Bin.Pred b Data.Type.Equality.~ 'Data.Bin.BP bp, Data.Type.BinP.Succ bp Data.Type.Equality.~ b) => Overloaded.Numerals.PosFromNumeral ('Data.Nat.S n) b instance (Overloaded.Numerals.PosFromNumeral (Data.Type.Nat.FromGHC n) b, Overloaded.Numerals.IsLess n (Data.Type.BinP.ToGHC b)) => Overloaded.Numerals.FromNumeral n (Data.BinP.PosP.PosP b) instance (Overloaded.Numerals.PosFromNumeral (Data.Type.Nat.FromGHC n) b, Overloaded.Numerals.IsLess n (Data.Type.BinP.ToGHC b)) => Overloaded.Numerals.FromNumeral n (Data.Bin.Pos.Pos ('Data.Bin.BP b)) instance Overloaded.Numerals.FinFromNumeral 'Data.Nat.Z ('Data.Nat.S m) instance Overloaded.Numerals.FinFromNumeral n m => Overloaded.Numerals.FinFromNumeral ('Data.Nat.S n) ('Data.Nat.S m) instance (Overloaded.Numerals.FinFromNumeral (Data.Type.Nat.FromGHC n) m, Overloaded.Numerals.IsLess n (Data.Type.Nat.ToGHC m)) => Overloaded.Numerals.FromNumeral n (Data.Fin.Fin m) instance (GHC.TypeNats.KnownNat n, Overloaded.Numerals.OverflowCheck n "Word8" (n GHC.TypeNats.<=? 255)) => Overloaded.Numerals.FromNumeral n GHC.Word.Word8 instance (GHC.TypeNats.KnownNat n, Overloaded.Numerals.OverflowCheck n "Word8" (n GHC.TypeNats.<=? 65535)) => Overloaded.Numerals.FromNumeral n GHC.Word.Word16 instance (GHC.TypeNats.KnownNat n, Overloaded.Numerals.OverflowCheck n "Word8" (n GHC.TypeNats.<=? 4294967295)) => Overloaded.Numerals.FromNumeral n GHC.Word.Word32 instance (GHC.TypeNats.KnownNat n, Overloaded.Numerals.OverflowCheck n "Word8" (n GHC.TypeNats.<=? 18446744073709551615)) => Overloaded.Numerals.FromNumeral n GHC.Word.Word64 instance GHC.TypeNats.KnownNat n => Overloaded.Numerals.FromNumeral n GHC.Natural.Natural instance GHC.TypeNats.KnownNat n => Overloaded.Numerals.FromNumeral n GHC.Integer.Type.Integer instance GHC.TypeNats.KnownNat n => Overloaded.Numerals.FromNumeral n GHC.Types.Int instance GHC.TypeNats.KnownNat n => Overloaded.Numerals.FromNumeral n Data.Nat.Nat instance GHC.TypeNats.KnownNat n => Overloaded.Numerals.FromNumeral n Data.Bin.Bin instance (GHC.TypeNats.KnownNat n, (1 GHC.TypeNats.<=? n) Data.Type.Equality.~ 'GHC.Types.True) => Overloaded.Numerals.FromNumeral n Data.BinP.BinP -- | Overloaded plugin, which makes magic possible. module Overloaded.Plugin -- | Overloaded plugin. -- -- To enable plugin put the following at top of the module: -- --
-- {-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:Symbols #-}
--
--
-- At least one option is required, multiple can given either using
-- multiple -fplugin-opt options, or by separating options with
-- colon:
--
--
-- {-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:Symbols:Numerals #-}
--
--
-- Options also take optional desugaring names, for example
--
--
-- {-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:Labels=Data.Generics.ProductFields.field #-}
--
--
-- to desugar OverloadedLabels directly into field from
-- generics-lens (no need to import orphan instance!)
--
--
-- {-# OPTIONS_GHC -ddump-simpl #-}
--
--
-- to avoid surprising segfaults.
--
--
-- class HasField {k} x r a | x r -> a where
-- hasField :: r -> (a -> r, a)
--
--
-- Suppose we have
--
--
-- data R y = MkR { foo :: [y] }
--
--
-- and foo in scope. We will solve constraints like
--
-- -- HasField "foo" (R Int) a ---- -- by emitting a new wanted constraint -- --
-- [Int] ~# a ---- -- and building a HasField dictionary out of selector -- foo appropriately cast. -- --
-- {-# LANGUAGE TemplateHaskellQuotes #-}
-- {-# OPTIONS_GHC -fplugin=Overloaded -fplugin-opt=Overloaded:IdiomBrackets #-}
--
-- data Tree a
-- = Leaf a
-- | Branch (Tree a) (Tree a)
-- deriving (Show)
--
-- instance Functor Tree where
-- fmap f (Leaf x) = Leaf (f x)
-- fmap f (Branch l r) = Branch (fmap f l) (fmap f r)
--
-- instance Traversable Tree where
-- traverse f (Leaf x) = [| Leaf (f x) |]
-- traverse f (Branch l r) = [| Branch (traverse f l) (traverse f r) |]
--
plugin :: Plugin
instance GHC.Show.Show a => GHC.Show.Show (Overloaded.Plugin.V4 a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Overloaded.Plugin.V4 a)
instance GHC.Show.Show Overloaded.Plugin.Options
instance GHC.Classes.Eq Overloaded.Plugin.Options
instance GHC.Show.Show a => GHC.Show.Show (Overloaded.Plugin.V2 a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Overloaded.Plugin.V2 a)
instance GHC.Show.Show Overloaded.Plugin.StrSym
instance GHC.Classes.Eq Overloaded.Plugin.StrSym
instance GHC.Show.Show Overloaded.Plugin.NumNat
instance GHC.Classes.Eq Overloaded.Plugin.NumNat
instance GHC.Show.Show Overloaded.Plugin.VarName
instance GHC.Classes.Eq Overloaded.Plugin.VarName
instance GHC.Show.Show a => GHC.Show.Show (Overloaded.Plugin.OnOff a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Overloaded.Plugin.OnOff a)
-- | Another way to desugar overloaded string literals. See
-- FromSymbol.
module Overloaded.Symbols
-- | Another way to desugar overloaded string literals using this class.
--
-- A string literal "example" is desugared to
--
-- -- fromSymbol @"example" ---- -- Enabled with: -- --
-- {-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:Symbols #-}
--
class FromSymbol (s :: Symbol) a
fromSymbol :: FromSymbol s a => a
instance (GHC.TypeNats.KnownNat y, GHC.TypeNats.KnownNat m, GHC.TypeNats.KnownNat d, Overloaded.Symbols.ParseDay s Data.Type.Equality.~ '(y, m, d)) => Overloaded.Symbols.FromSymbol s Data.Time.Calendar.Days.Day
instance (GHC.TypeLits.KnownSymbol s, Overloaded.Symbols.SeqList (Data.Symbol.Ascii.Internal.ToList s)) => Overloaded.Symbols.FromSymbol s Data.ByteString.Internal.ByteString
instance (GHC.TypeLits.KnownSymbol s, Overloaded.Symbols.SeqList (Data.Symbol.Ascii.Internal.ToList s)) => Overloaded.Symbols.FromSymbol s Data.ByteString.Lazy.Internal.ByteString
instance (GHC.TypeLits.KnownSymbol s, a Data.Type.Equality.~ GHC.Types.Char) => Overloaded.Symbols.FromSymbol s [a]
instance GHC.TypeLits.KnownSymbol s => Overloaded.Symbols.FromSymbol s Data.Text.Internal.Text
instance GHC.TypeLits.KnownSymbol s => Overloaded.Symbols.FromSymbol s Data.Text.Internal.Lazy.Text
-- | Overloaded type-level natural numbers.
module Overloaded.TypeNats
-- | A way to overload type level Nats.
--
-- A number type-literal 42 is desugared to
--
-- -- FromNat 42 ---- -- Enabled with: -- --
-- {-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:TypeNats #-}
--
class FromNatC a where {
type family FromNat (n :: Nat) :: a;
}
instance Overloaded.TypeNats.FromNatC GHC.Types.Nat
instance Overloaded.TypeNats.FromNatC Data.Nat.Nat
instance Overloaded.TypeNats.FromNatC Data.Bin.Bin
instance Overloaded.TypeNats.FromNatC Data.BinP.BinP
-- | Overloaded type-level symbols.
module Overloaded.TypeSymbols
-- | A way to overload type level Symbols.
--
-- A symbol type-literal "example" is desugared to
--
-- -- FromTypeSymbol "example" ---- -- Enabled with: -- --
-- {-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:TypeSymbols #-}
--
class FromTypeSymbolC a where {
type family FromTypeSymbol (s :: Symbol) :: a;
}
instance Overloaded.TypeSymbols.FromTypeSymbolC GHC.Types.Symbol
-- | Overloaded* language extensions as a source plugin.
module Overloaded
-- | Overloaded plugin.
--
-- To enable plugin put the following at top of the module:
--
--
-- {-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:Symbols #-}
--
--
-- At least one option is required, multiple can given either using
-- multiple -fplugin-opt options, or by separating options with
-- colon:
--
--
-- {-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:Symbols:Numerals #-}
--
--
-- Options also take optional desugaring names, for example
--
--
-- {-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:Labels=Data.Generics.ProductFields.field #-}
--
--
-- to desugar OverloadedLabels directly into field from
-- generics-lens (no need to import orphan instance!)
--
--
-- {-# OPTIONS_GHC -ddump-simpl #-}
--
--
-- to avoid surprising segfaults.
--
--
-- class HasField {k} x r a | x r -> a where
-- hasField :: r -> (a -> r, a)
--
--
-- Suppose we have
--
--
-- data R y = MkR { foo :: [y] }
--
--
-- and foo in scope. We will solve constraints like
--
-- -- HasField "foo" (R Int) a ---- -- by emitting a new wanted constraint -- --
-- [Int] ~# a ---- -- and building a HasField dictionary out of selector -- foo appropriately cast. -- --
-- {-# LANGUAGE TemplateHaskellQuotes #-}
-- {-# OPTIONS_GHC -fplugin=Overloaded -fplugin-opt=Overloaded:IdiomBrackets #-}
--
-- data Tree a
-- = Leaf a
-- | Branch (Tree a) (Tree a)
-- deriving (Show)
--
-- instance Functor Tree where
-- fmap f (Leaf x) = Leaf (f x)
-- fmap f (Branch l r) = Branch (fmap f l) (fmap f r)
--
-- instance Traversable Tree where
-- traverse f (Leaf x) = [| Leaf (f x) |]
-- traverse f (Branch l r) = [| Branch (traverse f l) (traverse f r) |]
--
plugin :: Plugin
-- | Another way to desugar overloaded string literals using this class.
--
-- A string literal "example" is desugared to
--
-- -- fromSymbol @"example" ---- -- Enabled with: -- --
-- {-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:Symbols #-}
--
class FromSymbol (s :: Symbol) a
fromSymbol :: FromSymbol s a => a
-- | Another way to desugar numerals.
--
-- A numeric literal 123 is desugared to
--
-- -- fromNumeral @123 ---- -- Enabled with: -- --
-- {-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:Numerals #-}
--
--
-- One can do type-level computations with this.
class FromNumeral (n :: Nat) a
fromNumeral :: FromNumeral n a => a
-- | Default implementation of fromNumeral.
--
-- Usage example:
--
-- -- instance (KnownNat n, ...) => FromNumeral n MyType where -- fromNumeral = defaultFromNumeral @n --defaultFromNumeral :: forall n a. (KnownNat n, Integral a) => a -- | Class for Natural-like datastructures -- -- A numeric literal 42 is desugared to -- --
-- fromNatural 42 --class FromNatural a fromNatural :: FromNatural a => Natural -> a -- | Class for Char-like datastructures -- -- A character literal x is desugared to -- --
-- fromChar 'x' --class FromChar a fromChar :: FromChar a => Char -> a -- | Class for nil, [] -- -- See test-suite for ways to define instances for Map. There are -- at-least two-ways. class Nil a nil :: Nil a => a -- | Class for Cons :. class Cons x ys zs | zs -> x ys cons :: Cons x ys zs => x -> ys -> zs infixr 5 `cons` -- | Class for Bool-like datastrucutres -- -- An if--expression if b then t else e is desugared to -- --
-- ifte (toBool b) t e ---- -- Enabled with: -- --
-- {-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:If #-}
--
class ToBool b
toBool :: ToBool b => b -> Bool
-- | ToBool overloaded if-expression.
ifte :: ToBool b => b -> a -> a -> a
-- | A way to overload type level Nats.
--
-- A number type-literal 42 is desugared to
--
-- -- FromNat 42 ---- -- Enabled with: -- --
-- {-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:TypeNats #-}
--
class FromNatC a where {
type family FromNat (n :: Nat) :: a;
}
-- | A way to overload type level Symbols.
--
-- A symbol type-literal "example" is desugared to
--
-- -- FromTypeSymbol "example" ---- -- Enabled with: -- --
-- {-# OPTIONS -fplugin=Overloaded -fplugin-opt=Overloaded:TypeSymbols #-}
--
class FromTypeSymbolC a where {
type family FromTypeSymbol (s :: Symbol) :: a;
}