cryptol-3.0.0: Cryptol: The Language of Cryptography

Copyright | (c) 2013-2016 Galois Inc.
License | BSD3
Maintainer | cryptol@galois.com
Stability | provisional
Portability | portable
Safe Haskell | Safe
Language | Haskell2010

Cryptol.Utils.Fixity

Description

Synopsis

- data Assoc
  - = LeftAssoc
  - | RightAssoc
  - | NonAssoc
- data Fixity = Fixity {
  - fAssoc :: !Assoc
  - fLevel :: !Int
  }
- defaultFixity :: Fixity
- data FixityCmp
  - = FCError
  - | FCLeft
  - | FCRight
- compareFixity :: Fixity -> Fixity -> FixityCmp

# Documentation

data Assoc Source #

Information about associativity.

Constructors

LeftAssoc |
RightAssoc |
NonAssoc |

#### Instances

Instances details

Generic Assoc Source # |
Instance details Defined in Cryptol.Utils.Fixity Associated Types type Rep Assoc :: Type -> Type Source # Methods from :: Assoc -> Rep Assoc x Source # to :: Rep Assoc x -> Assoc Source #
Show Assoc Source # |
Instance details Defined in Cryptol.Utils.Fixity Methods showsPrec :: Int -> Assoc -> ShowS Source # show :: Assoc -> String Source # showList :: [Assoc] -> ShowS Source #
PP Assoc Source # |
Instance details Defined in Cryptol.Utils.PP Methods ppPrec :: Int -> Assoc -> Doc Source #
NFData Assoc Source # |
Instance details Defined in Cryptol.Utils.Fixity Methods rnf :: Assoc -> () Source #
Eq Assoc Source # |
Instance details Defined in Cryptol.Utils.Fixity Methods (==) :: Assoc -> Assoc -> Bool Source # (/=) :: Assoc -> Assoc -> Bool Source #
Ord Assoc Source # |
Instance details Defined in Cryptol.Utils.Fixity Methods compare :: Assoc -> Assoc -> Ordering Source # (<) :: Assoc -> Assoc -> Bool Source # (<=) :: Assoc -> Assoc -> Bool Source # (>) :: Assoc -> Assoc -> Bool Source # (>=) :: Assoc -> Assoc -> Bool Source # max :: Assoc -> Assoc -> Assoc Source # min :: Assoc -> Assoc -> Assoc Source #
type Rep Assoc Source # |
Instance details Defined in Cryptol.Utils.Fixity type Rep Assoc = D1 ('MetaData "Assoc" "Cryptol.Utils.Fixity" "cryptol-3.0.0-DBVDUAjB1JeD0WzkHH4ckn" 'False) (C1 ('MetaCons "LeftAssoc" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "RightAssoc" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NonAssoc" 'PrefixI 'False) (U1 :: Type -> Type)))

data Fixity Source #

Constructors

Fixity |

Fields

- fAssoc :: !Assoc
- fLevel :: !Int

#### Instances

Instances details

Generic Fixity Source # |
Instance details Defined in Cryptol.Utils.Fixity Associated Types type Rep Fixity :: Type -> Type Source # Methods from :: Fixity -> Rep Fixity x Source # to :: Rep Fixity x -> Fixity Source #
Show Fixity Source # |
Instance details Defined in Cryptol.Utils.Fixity Methods showsPrec :: Int -> Fixity -> ShowS Source # show :: Fixity -> String Source # showList :: [Fixity] -> ShowS Source #
PP Fixity Source # |
Instance details Defined in Cryptol.Utils.PP Methods ppPrec :: Int -> Fixity -> Doc Source #
NFData Fixity Source # |
Instance details Defined in Cryptol.Utils.Fixity Methods rnf :: Fixity -> () Source #
Eq Fixity Source # |
Instance details Defined in Cryptol.Utils.Fixity Methods (==) :: Fixity -> Fixity -> Bool Source # (/=) :: Fixity -> Fixity -> Bool Source #
Ord Fixity Source # |
Instance details Defined in Cryptol.Utils.Fixity Methods compare :: Fixity -> Fixity -> Ordering Source # (<) :: Fixity -> Fixity -> Bool Source # (<=) :: Fixity -> Fixity -> Bool Source # (>) :: Fixity -> Fixity -> Bool Source # (>=) :: Fixity -> Fixity -> Bool Source # max :: Fixity -> Fixity -> Fixity Source # min :: Fixity -> Fixity -> Fixity Source #
type Rep Fixity Source # |
Instance details Defined in Cryptol.Utils.Fixity type Rep Fixity = D1 ('MetaData "Fixity" "Cryptol.Utils.Fixity" "cryptol-3.0.0-DBVDUAjB1JeD0WzkHH4ckn" 'False) (C1 ('MetaCons "Fixity" 'PrefixI 'True) (S1 ('MetaSel ('Just "fAssoc") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Assoc) :*: S1 ('MetaSel ('Just "fLevel") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)))

defaultFixity :: Fixity Source #

The fixity used when none is provided.

data FixityCmp Source #

Constructors

FCError |
FCLeft |
FCRight |

#### Instances

Instances details

Show FixityCmp Source # |
Instance details Defined in Cryptol.Utils.Fixity Methods showsPrec :: Int -> FixityCmp -> ShowS Source # show :: FixityCmp -> String Source # showList :: [FixityCmp] -> ShowS Source #
Eq FixityCmp Source # |
Instance details Defined in Cryptol.Utils.Fixity Methods (==) :: FixityCmp -> FixityCmp -> Bool Source # (/=) :: FixityCmp -> FixityCmp -> Bool Source #

compareFixity :: Fixity -> Fixity -> FixityCmp Source #

Let `op1` have fixity `f1` and `op2` have fixity `f2. Then` compareFixity f1 f2`determines how to parse the infix expression` x op1 y op2 z@.

- `FCLeft`: `(x op1 y) op2 z`
- `FCRight`: `x op1 (y op2 z)`
- `FCError`: no parse