cryptol-2.8.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.Parser.Selector

Description

Synopsis

- data Selector
  - = TupleSel Int (Maybe Int)
  - | RecordSel Ident (Maybe [Ident])
  - | ListSel Int (Maybe Int)
- ppSelector :: Selector -> Doc
- ppNestedSels :: [Selector] -> Doc
- selName :: Selector -> Ident

# Documentation

data Selector Source #

Selectors are used for projecting from various components. Each selector has an option spec to specify the shape of the thing that is being selected. Currently, there is no surface syntax for list selectors, but they are used during the desugaring of patterns.

Constructors

TupleSel Int (Maybe Int) | Zero-based tuple selection. Optionally specifies the shape of the tuple (one-based).
RecordSel Ident (Maybe [Ident]) | Record selection. Optionally specifies the shape of the record.
ListSel Int (Maybe Int) | List selection. Optionally specifies the length of the list.

#### Instances

Instances details

Eq Selector Source # |
Instance details Defined in Cryptol.Parser.Selector Methods (==) :: Selector -> Selector -> Bool Source # (/=) :: Selector -> Selector -> Bool Source #
Ord Selector Source # |
Instance details Defined in Cryptol.Parser.Selector Methods compare :: Selector -> Selector -> Ordering Source # (<) :: Selector -> Selector -> Bool Source # (<=) :: Selector -> Selector -> Bool Source # (>) :: Selector -> Selector -> Bool Source # (>=) :: Selector -> Selector -> Bool Source # max :: Selector -> Selector -> Selector Source # min :: Selector -> Selector -> Selector Source #
Show Selector Source # |
Instance details Defined in Cryptol.Parser.Selector Methods showsPrec :: Int -> Selector -> ShowS Source # show :: Selector -> String Source # showList :: [Selector] -> ShowS Source #
Generic Selector Source # |
Instance details Defined in Cryptol.Parser.Selector Associated Types type Rep Selector :: Type -> Type Source # Methods from :: Selector -> Rep Selector x Source # to :: Rep Selector x -> Selector Source #
NFData Selector Source # |
Instance details Defined in Cryptol.Parser.Selector Methods rnf :: Selector -> () Source #
PP Selector Source # |
Instance details Defined in Cryptol.Parser.Selector Methods ppPrec :: Int -> Selector -> Doc Source #
ShowParseable Selector Source # |
Instance details Defined in Cryptol.TypeCheck.Parseable Methods showParseable :: Selector -> Doc Source #
type Rep Selector Source # |

Instance details

Defined in Cryptol.Parser.Selector

type Rep Selector = D1 ('MetaData "Selector" "Cryptol.Parser.Selector" "cryptol-2.8.0-11Z6ZaBuQbo1UTYpHYMeUg" 'False) (C1 ('MetaCons "TupleSel" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int))) :+: (C1 ('MetaCons "RecordSel" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ident) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Ident]))) :+: C1 ('MetaCons "ListSel" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)))))

ppSelector :: Selector -> Doc Source #

Display the thing selected by the selector, nicely.

ppNestedSels :: [Selector] -> Doc Source #

Show a list of selectors as they appear in a nested selector in an update.

selName :: Selector -> Ident Source #

The name of a selector (e.g., used in update code)