Hoogle Search

Within LTS Haskell 24.4 (ghc-9.10.2)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. stripSuffix :: Eq a => [a] -> [a] -> Maybe [a]

    lens Control.Lens.Internal.List

    The stripSuffix function drops the given suffix from a list. It returns Nothing if the list did not end with the suffix given, or Just the list after the suffix, if it does.

    >>> stripSuffix "bar" "foobar"
    Just "foo"
    
    >>> stripSuffix "foo" "foo"
    Just ""
    
    >>> stripSuffix "bar" "barfoo"
    Nothing
    
    >>> stripSuffix "foo" "barfoobaz"
    Nothing
    

  2. class Prefixed t

    lens Control.Lens.Prism

    No documentation available.

  3. class Suffixed t

    lens Control.Lens.Prism

    No documentation available.

  4. prefixed :: Prefixed t => t -> Prism' t t

    lens Control.Lens.Prism

    A Prism stripping a prefix from a sequence when used as a Traversal, or prepending that prefix when run backwards:

    >>> "preview" ^? prefixed "pre"
    Just "view"
    
    >>> "review" ^? prefixed "pre"
    Nothing
    
    >>> prefixed "pre" # "amble"
    "preamble"
    

  5. suffixed :: Suffixed t => t -> Prism' t t

    lens Control.Lens.Prism

    A Prism stripping a suffix from a sequence when used as a Traversal, or appending that suffix when run backwards:

    >>> "review" ^? suffixed "view"
    Just "re"
    
    >>> "review" ^? suffixed "tire"
    Nothing
    
    >>> suffixed ".o" # "hello"
    "hello.o"
    

  6. classUnderscoreNoPrefixFields :: LensRules

    lens Control.Lens.TH

    Field rules for fields in the form _fieldname (the leading underscore is mandatory). Note: The primary difference to camelCaseFields is that for classUnderscoreNoPrefixFields the field names are not expected to be prefixed with the type name. This might be the desired behaviour when the DuplicateRecordFields extension is enabled.

  7. classUnderscoreNoPrefixNamer :: FieldNamer

    lens Control.Lens.TH

    A FieldNamer for classUnderscoreNoPrefixFields.

  8. makeFieldsNoPrefix :: Name -> DecsQ

    lens Control.Lens.TH

    Generate overloaded field accessors based on field names which are only prefixed with an underscore (e.g. _name), not additionally with the type name (e.g. _fooName). This might be the desired behaviour in case the DuplicateRecordFields language extension is used in order to get rid of the necessity to prefix each field name with the type name. As an example:

    data Foo a  = Foo { _x :: Int, _y :: a }
    newtype Bar = Bar { _x :: Char }
    makeFieldsNoPrefix ''Foo
    makeFieldsNoPrefix ''Bar
    
    will create classes
    class HasX s a | s -> a where
    x :: Lens' s a
    class HasY s a | s -> a where
    y :: Lens' s a
    
    together with instances
    instance HasX (Foo a) Int
    instance HasY (Foo a) a where
    instance HasX Bar Char where
    
    For details, see classUnderscoreNoPrefixFields.
    makeFieldsNoPrefix = makeLensesWith classUnderscoreNoPrefixFields
    

  9. underscoreNoPrefixNamer :: FieldNamer

    lens Control.Lens.TH

    A FieldNamer that strips the _ off of the field name, lowercases the name, and skips the field if it doesn't start with an '_'.

  10. class Prefixed t

    lens Data.List.Lens

    No documentation available.

Page 46 of many | Previous | Next