type-prelude-0.1: Partial port of prelude to the type level. Requires GHC 7.6.1.

Safe HaskellNone

Prelude.Type

Contents

Description

A Prelude for type-level programming with type classes

This module includes a partial port of the Prelude as type class predicates and pseudo-syntax for caseif-then-elselambda.

TODO:

  • Lambda is useless because the variables are not copied. I need some form of prolog's copy_term.
  • Type families don't match if the kinds are too polymorphic, see example for Compose.
  • Match and Case need some fine tuning.
  • Once the solver for Nat works, implement Num Nat and changes some uses of Integer to Nat
  • The GHC Constraint solver doesn't seem to flatten tuple constraints, which sometimes causes it to diverge. For some complex constraints C, C => a converges but ((), C) => a diverges

Synopsis

Documentation

module Prelude

Syntax emulation

class Lambda1 a c a' | a' c -> aSource

Lambda

Instances

c => Lambda1 k a c a 

class Lambda2 a b c a' b' | a' b' c -> a bSource

Instances

c => Lambda2 k k1 a b c a b 

class Lambda3 a b d c a' b' d' | a' b' d' c -> a b dSource

Instances

c => Lambda3 k k1 k2 a b d c a b d 

class Lambda4 a b d e c a' b' d' e' | a' b' d' e' c -> a b d eSource

Instances

c => Lambda4 k k1 k2 k3 a b d e c a b d e 

type family Lambda :: kSource

class If p a b Source

If Then Else

Instances

(p x, If Constraint x a b) => If p a b 

class Case a c Source

Case

Instances

Error ((,) Symbol k) ((,) Symbol k "Case: No matching alternative for" a) => Case k a ([] (Alternative k Constraint)) 
(Match k a x p, Case' k p b a cs) => Case k a (: (Alternative k Constraint) (--> k Constraint x b) cs) 
b => Case k a (: (Alternative k Constraint) (Otherwise k Constraint b) ([] (Alternative k Constraint))) 

class Case' p b a cs Source

Instances

Case k a cs => Case' k False b a cs 
b => Case' k True b a cs 

data Alternative a b Source

Constructors

(-->) a b 
Otherwise b 

Instances

Error ((,) Symbol k) ((,) Symbol k "Case: No matching alternative for" a) => Case k a ([] (Alternative k Constraint)) 
(Match k a x p, Case' k p b a cs) => Case k a (: (Alternative k Constraint) (--> k Constraint x b) cs) 
b => Case k a (: (Alternative k Constraint) (Otherwise k Constraint b) ([] (Alternative k Constraint))) 

Type Classes

Show

class Show a b | a -> bSource

Instances

Shows k a ([] Symbol) b => Show k a b 

class Shows a b c | a b -> cSource

Instances

~ [Symbol] y (Shows Ordering o x) => Shows Ordering o x y 
If (> Integer i (I 0)) (ShowsInteger i x y) (Negate Integer i j, ShowsInteger j x y', ~ [Symbol] y (: Symbol "-" y')) => Shows Integer i x y 
Shows Bool False x (: Symbol "False" x) 
Shows Bool True x (: Symbol "True" x) 
Shows Symbol a x (: Symbol a x) 
Shows () () x (: Symbol "()" x) 
Shows Integer Zeros x (: Symbol "0" x) 
Shows [k] ([] k) x (: Symbol "[]" x) 
Shows (Maybe k) (Nothing k) x (: Symbol "Nothing" x) 
Shows k a x y => Shows (Maybe k) (Just k a) x (: Symbol "Just" y) 
(Shows k a y z, ShowsTail k l (: Symbol "]" x) y) => Shows [k] (: k a l) x (: Symbol "[" z) 
Shows k1 a x y => Shows (Either k k1) (Right k k1 a) x (: Symbol "Right" y) 
Shows k a x y => Shows (Either k k1) (Left k k1 a) x (: Symbol "Left" y) 
(Shows k a (: Symbol "," y) z, Shows k1 b (: Symbol ")" x) y) => Shows ((,) k k1) ((,) k k1 a b) x (: Symbol "(" z) 
(Shows k a (: Symbol "," y) z, Shows k1 b (: Symbol "," x) y, Shows k2 c (: Symbol ")" w) x) => Shows ((,,) k k1 k2) ((,,) k k1 k2 a b c) w (: Symbol "(" z) 
(Shows k a (: Symbol "," y) z, Shows k1 b (: Symbol "," x) y, Shows k2 c (: Symbol "," w) x, Shows k3 d (: Symbol ")" v) w) => Shows ((,,,) k k1 k2 k3) ((,,,) k k1 k2 k3 a b c d) v (: Symbol "(" z) 

Kind

class Kind a k' | k -> k', k' -> kSource

Get kind of a type

Instances

Kind Bool a Bool 
Kind Ordering a Ordering 
Kind * a StarKind 
Kind Nat a Nat 
Kind Symbol a Symbol 
Kind () () () 
Kind Integer a Integer 
Kind [k] ([] k) [k1] 
Kind (Maybe k) (Nothing k) (Maybe k1) 
Kind k a k1 => Kind (Maybe k) (Just k a) (Maybe k1) 
Kind k x k1 => Kind [k] (: k x xs) [k1] 
Kind k1 a k2 => Kind (Either k k1) (Right k k1 a) (Either l k2) 
Kind k a k2 => Kind (Either k k1) (Left k k1 a) (Either k2 l) 
(Kind k a k2, Kind k1 b l) => Kind ((,) k k1) ((,) k k1 a b) (k2, l) 
(Kind k a k3, Kind k1 b l, Kind k2 c m) => Kind ((,,) k k1 k2) ((,,) k k1 k2 a b c) (k3, l, m) 
(Kind k a k4, Kind k1 b l, Kind k2 c m, Kind k3 d n) => Kind ((,,,) k k1 k2 k3) ((,,,) k k1 k2 k3 a b c d) (k4, l, m, n) 

Eq

class (a (==) b) p | a b -> pSource

Instances

~ Bool p (== Bool a b) => (Bool == a) b p 
TypeEq Ordering a b p => (Ordering == a) b p 
TypeEq * a b p => (* == a) b p 
TypeEq Nat a b p => (Nat == a) b p 
TypeEq Symbol a b p => (Symbol == a) b p 
(() == a) b True 
~ Bool p False => (Integer == i) j p 
(Integer == Zeros) Zeros True 
(Integer == Ones) Ones True 
== Integer i j p => (Integer == (Zero i)) (Zero j) p 
== Integer i j p => (Integer == (One i)) (One j) p 
([k] == ([] k)) ([] k) True 
((Maybe k) == (Nothing k)) (Nothing k) True 
((Maybe k) == (Nothing k)) (Just k b) False 
((Maybe k) == (Just k a)) (Nothing k) False 
== k a b p => ((Maybe k) == (Just k a)) (Just k b) p 
(== k x y p, == [k] xs zs q, && p q o) => ([k] == (: k x xs)) (: k y ys) o 
((Either k k1) == (Right k k1 a)) (Left k k1 b) False 
((Either k k1) == (Left k k1 a)) (Right k k1 b) False 
== k1 a b p => ((Either k k1) == (Right k k1 a)) (Right k k1 b) p 
== k1 a b p => ((Either k1 k) == (Left k1 k a)) (Left k1 k b) p 
(== k a w p, == k1 b x q, && p q o) => (((,) k k1) == ((,) k k1 a b)) ((,) k k1 w x) o 
(== k a w p, == k1 b x q, == k2 c y r, && p q n, && n r p) => (((,,) k k1 k2) == ((,,) k k1 k2 a b c)) ((,,) k k1 k2 w x y) o 
(== k a w p, == k1 b x q, == k2 c y r, == k3 d z s, && p q m, && r s n, && m n o) => (((,,,) k k1 k2 k3) == ((,,,) k k1 k2 k3 a b c d)) ((,,,) k k1 k2 k3 w x y z) o 

class (a (/=) b) p | a b -> pSource

Instances

(== k a b p, Not p q) => (k /= a) b q 

Ord

class Compare a b o | a b -> oSource

Instances

~ Ordering o (Compare Bool a b) => Compare Bool a b o 
~ Ordering o (Compare Ordering a b) => Compare Ordering a b o 
Compare () () () EQ 
(Minus Integer a b d, Signum Integer d s, Case Integer s (: (Alternative Integer Constraint) (--> Integer Constraint Ones (~ Ordering p LT)) (: (Alternative Integer Constraint) (--> Integer Constraint Zeros (~ Ordering p EQ)) (: (Alternative Integer Constraint) (--> Integer Constraint (One Zeros) (~ Ordering p GT)) (: (Alternative Integer Constraint) (Otherwise Integer Constraint (Error ((,) Symbol Integer) ((,) Symbol Integer "Signum returned" s))) ([] (Alternative Integer Constraint))))))) => Compare Integer a b p 
Compare [k] ([] k) ([] k) EQ 
Compare (Maybe k) (Nothing k) (Nothing k) EQ 
Compare (Maybe k) (Nothing k) (Just k a) LT 
Compare [k] ([] k) (: k x xs) LT 
Compare (Maybe k) (Just k a) (Nothing k) GT 
Compare k a b o => Compare (Maybe k) (Just k a) (Just k b) o 
Compare [k] (: k x xs) ([] k) GT 
(Compare k x y o, Case Ordering o (: (Alternative Ordering Constraint) (--> Ordering Constraint EQ (Compare [k] xs ys r)) (: (Alternative Ordering Constraint) (--> Ordering Constraint o (~ Ordering o r)) ([] (Alternative Ordering Constraint))))) => Compare [k] (: k x xs) (: k y ys) r 
Compare k1 a b o => Compare (Either k1 k) (Left k1 k a) (Left k1 k b) o 
Compare k1 a b o => Compare (Either k k1) (Right k k1 a) (Right k k1 b) o 
Compare (Either k k1) (Right k k1 a) (Left k k1 b) GT 
Compare (Either k k1) (Left k k1 a) (Right k k1 b) LT 
(Compare k a e o, Case Ordering o (: (Alternative Ordering Constraint) (--> Ordering Constraint EQ (Compare k1 b f r)) (: (Alternative Ordering Constraint) (--> Ordering Constraint o (~ Ordering o r)) ([] (Alternative Ordering Constraint))))) => Compare ((,) k k1) ((,) k k1 a b) ((,) k k1 e f) r 
(Compare k a e o, Case Ordering o (: (Alternative Ordering Constraint) (--> Ordering Constraint EQ (Compare ((,) k1 k2) ((,) k1 k2 b c) ((,) k1 k2 f g) r)) (: (Alternative Ordering Constraint) (--> Ordering Constraint o (~ Ordering o r)) ([] (Alternative Ordering Constraint))))) => Compare ((,,) k k1 k2) ((,,) k k1 k2 a b c) ((,,) k k1 k2 e f g) r 
(Compare k a e o, Case Ordering o (: (Alternative Ordering Constraint) (--> Ordering Constraint EQ (Compare ((,,) k1 k2 k3) ((,,) k1 k2 k3 b c d) ((,,) k1 k2 k3 f g h) r)) (: (Alternative Ordering Constraint) (--> Ordering Constraint o (~ Ordering o r)) ([] (Alternative Ordering Constraint))))) => Compare ((,,,) k k1 k2 k3) ((,,,) k k1 k2 k3 a b c d) ((,,,) k k1 k2 k3 e f g h) r 

class Max a b max Source

class Min a b min Source

Enum

class ToEnum i a | k i -> aSource

Instances

ToEnum Bool Zeros False 
ToEnum () Zeros () 
~ k o (ToEnum k i) => ToEnum k i o 
ToEnum Integer i i 
ToEnum Bool (One Zeros) True 
(Minus Integer j (I 1) i, ToEnum k i a, ~ (Maybe k) e (Just k a)) => ToEnum (Maybe k) j e 
ToEnum (Maybe k) Zeros (Nothing k) 

class FromEnum a i | a -> iSource

class Succ a b | a -> bSource

Instances

(FromEnum k a i, + Integer i (I 1) j, ToEnum k j b) => Succ k a b 

class Pred a b | a -> bSource

Instances

(FromEnum k a i, Minus Integer i (I 1) j, ToEnum k j b) => Pred k a b 

class EnumFromTo a b l | a b -> lSource

Instances

(FromEnum k a i, FromEnum k b j, EnumFromTo Integer i j k1, Map Integer k (ToEnum k) k1 l) => EnumFromTo k a b l 
If (< Integer b a) (~ [Integer] l ([] Integer)) (+ Integer (I 1) a c, EnumFromTo Integer c b k, ~ [Integer] l (: Integer a k)) => EnumFromTo Integer a b l 

class EnumFromThenTo a c b l | a c b -> lSource

Instances

(FromEnum k a i, FromEnum k c h, FromEnum k b j, EnumFromThenTo Integer i h j k1, Map Integer k (ToEnum k) k1 l) => EnumFromThenTo k a c b l 
(Minus Integer c a x, EnumFromToBy Integer a b x l) => EnumFromThenTo Integer a c b l 

class EnumFromToBy a b c l | a b c -> lSource

Instances

If (< k b a) (~ [k] l ([] k)) (+ k c a d, EnumFromToBy k d b c k1, ~ [k] l (: k a k1)) => EnumFromToBy k a b c l 

Bounded

class MinBound a | k -> aSource

Instances

~ k (MinBound k) a => MinBound k a 

class MaxBound a | k -> aSource

Instances

~ k (MaxBound k) a => MaxBound k a 

Primitive kinds

Unit

Maybe

Bool

class Not a b | a -> bSource

Instances

class (a (||) b) c | a b -> cSource

Instances

(False || False) False 
~ Bool True p => (a || b) p 

class (a (&&) b) c | a b -> cSource

Instances

(True && True) True 
~ Bool False p => (a && b) p 

Ordering

Either

Tuples

class Fst p x | p -> xSource

Instances

Fst k k1 ((,) k k1 a b) a 

class Snd p x | p -> xSource

Instances

Snd k k1 ((,) k k1 a b) b 

Type Literals

Star

data StarKind Source

The Kind *

Instances

Predicates/Constraints

class Compose1 f g x z | f g -> x zSource

Instances

(g x y, f y z) => Compose1 k k1 k2 f g x z 

class Compose2 f g x z a | f g -> x zSource

Instances

(g x y, f y z a) => Compose2 k k1 k2 k3 f g x z a 

class Compose3 f g x z a b | f g -> x zSource

Instances

(g x y, f y z a b) => Compose3 k k1 k2 k3 k4 f g x z a b 

class Compose4 f g x z a b c | f g -> x zSource

Instances

(g x y, f y z a b c) => Compose4 k k1 k2 k3 k4 k5 f g x z a b c 

type family Compose :: kSource

class Partial1 f x y | f x -> ySource

Instances

Partial1 k k1 f x (f x) 

class Partial2 f x m y | f x m -> ySource

Instances

Partial2 k k1 k2 f x y (f x y) 

class Partial3 f x m n y | f x m n -> ySource

Instances

Partial3 k k1 k2 k3 f x y z (f x y z) 

class Partial4 f x m n o y | f x m n o -> ySource

Instances

Partial4 k k1 k2 k3 k4 f x y z a (f x y z a) 

type family Partial :: kSource

class Apply1 f x Source

Instances

(x y, f y) => Apply1 k f x 

class Apply2 f x e Source

Instances

(x y, f y e) => Apply2 k k1 f x e 

class Apply3 f x e g Source

Instances

(x y, f y e g) => Apply3 k k1 k2 f x e g 

class Apply4 f x e h g Source

Instances

(x y, f y e g h) => Apply4 k k1 k2 k3 f x e g h 

type family a ($) b :: kSource

class Id a b | a -> b, b -> aSource

Instances

Id k a a 

class Flip1 f x y Source

Instances

f y x => Flip1 k k1 f x y 

class Flip2 f x y m Source

Instances

f y x m => Flip2 k k1 k2 f x y m 

class Flip3 f x y m n Source

Instances

f y x m n => Flip3 k k1 k2 k3 f x y m n 

class Flip4 f x y m n o Source

Instances

f y x m n o => Flip4 k k1 k2 k3 k4 f x y m n o 

type family Flip :: (x -> y -> k) -> y -> x -> kSource

class Const1 a b c | a -> c, c -> aSource

Instances

Const1 k k1 a b a 

class Const2 a b c d | a -> d, d -> aSource

Instances

Const2 k k1 k2 a b c a 

class Const3 a b c d e | a -> e, e -> aSource

Instances

Const3 k k1 k2 k3 a b c d a 

class Const4 a b c d e f | a -> f, f -> aSource

Instances

Const4 k k1 k2 k3 k4 a b c d e a 

type family Const :: kSource

class Until p f x y Source

Instances

If (p x) (~ k x y) (f x x', Until k p f x' y) => Until k p f x y 

Lists

class ShowsTail a x y | a x -> ySource

Instances

ShowsTail k ([] k) x (: Symbol "]" x) 
(Shows k a y z, ShowsTail k l x y) => ShowsTail k (: k a l) x (: Symbol "," z) 

class Map f l j | f l -> jSource

Instances

Map k k1 f ([] k) ([] k1) 
(f x y, Map k k1 f xs ys) => Map k k1 f (: k x xs) (: k1 y ys) 

class FoldR f nil list ret | f nil list -> retSource

Instances

Id k1 nil ret => FoldR k k1 f nil ([] k) ret 
(FoldR k1 k f nil xs tail, f x tail ret) => FoldR k1 k f nil (: k1 x xs) ret 

class FoldL f accum list ret | f accum list -> retSource

Instances

FoldL k k1 f accum ([] k1) accum 
(f accum x accum', FoldL k k1 f accum' xs ret) => FoldL k k1 f accum (: k1 x xs) ret 

class Head l x | l -> xSource

Instances

Error Symbol "Head: empty list" => Head k ([] k) a 
Head k (: k x xs) x 

class Tail l x | l -> xSource

Instances

Error Symbol "Tail: empty list" => Tail k ([] k) a 
Tail k (: k x xs) xs 

class Last l x | l -> xSource

Instances

Error Symbol "Last: empty list" => Last k ([] k) a 
Last k (: k y xs) a => Last k (: k x (: k y xs)) a 
~ k a b => Last k (: k a ([] k)) b 

class Init l x | l -> xSource

Instances

Error Symbol "Init: empty list" => Init k ([] k) a 
Init k (: k a ([] k)) ([] k) 
Init k (: k y xs) a => Init k (: k x (: k y xs)) (: k x a) 

class Null l p | l -> pSource

Instances

Null k ([] k) True 
Null k (: k x xs) False 

class Length l i | l -> iSource

Instances

Length k ([] k) Zeros 
(Length k xs n, + Integer (I 1) n i) => Length k (: k x xs) i 

class (l (!!) n) x | l n -> xSource

Instances

Error Symbol "(!!): index too large" => (k !! ([] k)) n x 
~ k y x => (k !! (: k x xs)) Zeros y 
(Drop k i xs ys, !! k ys i y) => (k !! (: k x xs)) (Zero i) y 
!! k xs i y => (k !! (: k x xs)) (One i) y 

class Drop i l k | i l -> kSource

Instances

Error Symbol "Drop: negative count" => Drop k Ones a b 
~ [k] a b => Drop k Zeros a b 
Drop k i ([] k) ([] k) 
(Drop k i xs ys, Drop k i ys zs) => Drop k (Zero i) xs zs 
(Drop k i xs ys, Drop k i ys zs) => Drop k (One i) (: k x xs) zs 

class (a (++) b) c | a b -> cSource

Instances

(k ++ ([] k)) b b 
++ k a b c => (k ++ (: k x a)) b (: k x c) 

type Concat = FoldR ++ `[]`Source

class ConcatMap f a b | f a -> bSource

Instances

(Map k [k1] f l k2, Concat k1 k2 j) => ConcatMap k k1 f l j 

class ScanL f x l k | f x l -> kSource

Instances

ScanL k1 k f x ([] k) (: k1 x ([] k1)) 
(f x y z, ScanL k1 k f z ys zs) => ScanL k1 k f x (: k y ys) (: k1 x zs) 

class ScanR f x l k | f x l -> kSource

Instances

ScanR k k1 f q ([] k) (: k1 q ([] k1)) 
(f x z y, ScanR k k1 f q xs (: k1 z ys)) => ScanR k k1 f q (: k x xs) (: k1 y (: k1 z ys)) 

class ScanFold1 c x y z | c x y -> zSource

Instances

c x y ys z => ScanFold1 k k2 k1 c x (: k2 y ys) z 

class Replicate i a l | i a -> lSource

Instances

(Replicate k (Minus Integer i (I 1)) a as, ~ [k] l (: k a as)) => Replicate k i a l 
Replicate k Zeros a ([] k) 

class Take i a b | i a -> bSource

Instances

Take k i ([] k) ([] k) 
If Constraint (IsZero i) (~ [k] b ([] k)) (Take k (Minus Integer i (I 1)) xs t, ~ [k] b (: k x t)) => Take k i (: k x xs) b 

class SplitAt i a b Source

Instances

(Take k i a x, Drop k i a y) => SplitAt k i a ((,) [k] [k] x y) 

class TakeWhile f x y Source

Instances

TakeWhile k f ([] k) ([] k) 
If (f x) (TakeWhile k f xs zs, ~ [k] ys (: k x zs)) (~ [k] ys ([] k)) => TakeWhile k f (: k x xs) ys 

class DropWhile f x y Source

Instances

DropWhile k f ([] k) ([] k) 
If (f x) (DropWhile k f xs ys) (~ [k] ys (: k x xs)) => DropWhile k f (: k x xs) ys 

class Span f x y Source

Instances

(TakeWhile k f a b, DropWhile k f a c) => Span k f a ((,) [k] [k] b c) 

class Break f x y Source

Instances

Break k f ([] k) ((,) [k] [k] ([] k) ([] k)) 
If (f x) (~ ((,) [k] [k]) y ((,) [k] [k] ([] k) (: k x xs))) (Break k f xs ((,) [k] [k] a b), ~ ((,) [k] [k]) y ((,) [k] [k] (: k x a) b)) => Break k f (: k x xs) y 

class Elem a b p | a b -> pSource

Instances

Elem k a ([] k) False 
If (== k a x) (~ Bool p True) (Elem k a xs p) => Elem k a (: k x xs) p 

Integer

class ShowsInteger i x y | i x -> ySource

Instances

(QuotRem' i (I 10) q r, ShowsInteger q (: Symbol (Digit r) x) y) => ShowsInteger i x y 
ShowsInteger Zeros x x 

class (a (+) b) sum | a b -> sumSource

Instances

AddWithCarry False a b sum => (Integer + a) b sum 

class AddWithCarry carry a b sum | carry a b -> sumSource

Instances

AddWithCarry False Zeros a a 
AddWithCarry False Ones Zeros Ones 
AddWithCarry True Zeros Ones Zeros 
AddWithCarry True Ones a a 
(~ ((,) Bool Bool) (Add3 carry (IntegerHead a) (IntegerHead b)) ((,) Bool Bool head carry'), ~ Integer (IntegerTail a) a', ~ Integer (IntegerTail b) b', AddWithCarry carry' a' b' tail, ~ Integer sum (IntegerCons head tail)) => AddWithCarry carry a b sum 

class Minus a b dif | a b -> difSource

Instances

(Complement Integer b cb, AddWithCarry True a cb dif) => Minus Integer a b dif 

class Negate a b | a -> bSource

Instances

(Complement Integer a b, + Integer b (I 1) c) => Negate Integer a c 

class (a (*) b) prod | a b -> prodSource

Instances

(Integer * Zeros) a Zeros 
Negate Integer a prod => (Integer * Ones) a prod 
(* Integer i a b, ~ Integer prod (IntegerCons False b)) => (Integer * (Zero i)) a prod 
(* Integer i a b, ~ Integer b' (IntegerCons False b), + Integer a b' prod) => (Integer * (One i)) a prod 
(Integer * (One Zeros)) a a 

class Signum a b | a -> bSource

Instances

class Subtract a b dif | a b -> difSource

Instances

Minus k b a dif => Subtract k a b dif 

class Even a p | a -> pSource

Instances

~ Bool p (IntegerHead i) => Even Integer i p 

class Odd a p | a -> pSource

class Gcd a b c | a b -> cSource

Instances

(Abs Integer x x', Abs Integer y y', Gcd' x' y' z) => Gcd Integer x y z 
Error Symbol "Gcd 0 0 is undefined" => Gcd Integer Zeros Zeros c 

class Gcd' x y z | x y -> zSource

Instances

(Rem Integer x y r, Gcd' y r z) => Gcd' x y z 
Gcd' x Zeros x 

Misc functions from the Prelude

class Error a Source

Instances

ERROR k a => Error k a 

class ERROR a Source

class AsKindOf a b | a -> b, b -> aSource

Instances

AsKindOf k a b 

Bits

class Xor a b c | a b -> c, b c -> c, a c -> bSource

Instances

~ Bool c (Xor Bool a b) => Xor Bool a b c 
(Xor Bool (IntegerHead a) (IntegerHead b) c, Xor Integer (IntegerTail a) (IntegerTail b) d, ~ Integer e (IntegerCons c d)) => Xor Integer a b e 
Xor Integer Zeros a a 
Complement Integer a b => Xor Integer Ones a b 

class (a (.&.) b) c | a b -> cSource

Instances

~ k c (.&. k a b) => (k .&. a) b c 
(Integer .&. Zeros) a Zeros 
(Integer .&. Ones) a a 
(.&. Bool False (IntegerHead b) c, .&. Integer a (IntegerTail b) d, ~ Integer e (IntegerCons c d)) => (Integer .&. (Zero a)) b e 
(.&. Bool True (IntegerHead b) c, .&. Integer a (IntegerTail b) d, ~ Integer e (IntegerCons c d)) => (Integer .&. (One a)) b e 

Integral

class QuotRem a b c | a b -> cSource

Instances

Error Symbol "Division by zero" => QuotRem Integer a Zeros b 
(Abs Integer a a', Abs Integer b b', QuotRem' a' b' q r, Signum Integer a sa, Signum Integer b sb, * Integer sa r rem, * Integer sa q q', * Integer sb q' quot) => QuotRem Integer a b ((,) Integer Integer quot rem) 

class QuotRem' a b q r Source

Instances

If (< Integer a b) (~ ((,) Integer Integer) ((,) Integer Integer q r) ((,) Integer Integer (I 0) a)) (* Integer (I 2) b b2, QuotRem' a b2 q' r', * Integer q' (I 2) q'', If (>= Integer r' b) (+ Integer (I 1) q'' q, Minus Integer r' b r) (~ Integer q q'', ~ Integer r' r)) => QuotRem' a b q r 

class Rem a b c | a b -> cSource

Instances

class Quot a b c | a b -> cSource

Instances

Miscellanous

class TypeEq' () x y b => TypeEq x y b | x y -> bSource

TypeEq

Instances

TypeEq' k () x y b => TypeEq k x y b 

class TypeEq' q x y b | q x y -> bSource

Instances

TypeEq'' k q x y b => TypeEq' k q x y b 
~ Bool b True => TypeEq' k () x x b 

class TypeEq'' q x y b | q x y -> bSource

Instances

TypeEq'' k () x y False 

module GHC.Prim