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. NoImplicitPrelude :: Extension

    hint Language.Haskell.Interpreter.Extension

    No documentation available.

  2. package prelude-compat

    Provide Prelude and Data.List with fixed content across GHC versions This package allows you to write warning-free code that compiles with versions of base before and after AMP and FTP, that is, base before and beginning with 4.8, respectively, and GHC before and beginning with 7.10, respectively. It serves three purposes:

    • Prevent you from name clashes of FTP-Prelude with locally defined functions having names like <*>, join, foldMap.
    • Prevent you from redundant import warnings if you manually import Data.Monoid or Control.Applicative.
    • Fix list functions to the list type, contrarily to the aim of the FTP. This way you are saved from length (2,1) == 1 and maximum (2,1) == 1, until you import Data.Foldable.
    You should add
    import Prelude2010
    import Prelude ()
    
    to your modules. This way, you must change all affected modules. If you want to avoid this you may try the prelude2010 package or if you already import Prelude explicitly, you may try to add
    Default-Extensions: CPP, NoImplicitPrelude
    CPP-Options: -DPrelude=Prelude2010
    
    to your Cabal file. In my opinion, this is the wrong way round. The presented Prelude2010 module should have been the one for GHC-7.10 and the Prelude with added and generalized list functions should have been an additional PreludeFTP, preferably exported by a separate package like all other alternate Prelude projects. But the purpose of the FTP was to save some import statements at the expense of blowing up the Foldable class and prevent simple ways to write code that works with GHC version before and starting with GHC-7.10 and that does not provoke warnings. Related packages:
    • 'base-compat': The opposite approach - Make future function definitions available in older GHC versions.
    • haskell2010: Defines the Prelude for Haskell 2010. Unfortunately, haskell2010 is not available anymore since GHC-7.10, because of the AMP.
    • 'numeric-prelude': It is intended to provide a refined numeric class hierarchy but it also provides a non-numeric subset of the Prelude that is more stable than the one of base.

  3. module Prelude2010

    No documentation available.

  4. module Rebase.Prelude

    This module reexports the non-conflicting definitions from the modules exported by this package, providing a much more featureful alternative to the standard Prelude. For details check out the source.

  5. module Turtle.Prelude

    This module provides a large suite of utilities that resemble Unix utilities. Many of these commands are just existing Haskell commands renamed to match their Unix counterparts:

    >>> :set -XOverloadedStrings
    
    >>> cd "/tmp"
    
    >>> pwd
    FilePath "/tmp"
    
    Some commands are Shells that emit streams of values. view prints all values in a Shell stream:
    >>> view (ls "/usr")
    FilePath "/usr/lib"
    FilePath "/usr/src"
    FilePath "/usr/sbin"
    FilePath "/usr/include"
    FilePath "/usr/share"
    FilePath "/usr/games"
    FilePath "/usr/local"
    FilePath "/usr/bin"
    
    >>> view (find (suffix "Browser.py") "/usr/lib")
    FilePath "/usr/lib/python3.4/idlelib/ClassBrowser.py"
    FilePath "/usr/lib/python3.4/idlelib/RemoteObjectBrowser.py"
    FilePath "/usr/lib/python3.4/idlelib/PathBrowser.py"
    FilePath "/usr/lib/python3.4/idlelib/ObjectBrowser.py"
    
    Use fold to reduce the output of a Shell stream:
    >>> import qualified Control.Foldl as Fold
    
    >>> fold (ls "/usr") Fold.length
    8
    
    >>> fold (find (suffix "Browser.py") "/usr/lib") Fold.head
    Just (FilePath "/usr/lib/python3.4/idlelib/ClassBrowser.py")
    
    Create files using output:
    >>> output "foo.txt" ("123" <|> "456" <|> "ABC")
    
    >>> realpath "foo.txt"
    FilePath "/tmp/foo.txt"
    
    Read in files using input:
    >>> stdout (input "foo.txt")
    123
    456
    ABC
    
    Format strings in a type safe way using format:
    >>> dir <- pwd
    
    >>> format ("I am in the "%fp%" directory") dir
    "I am in the /tmp directory"
    
    Commands like grep, sed and find accept arbitrary Patterns
    >>> stdout (grep ("123" <|> "ABC") (input "foo.txt"))
    123
    ABC
    
    >>> let exclaim = fmap (<> "!") (plus digit)
    
    >>> stdout (sed exclaim (input "foo.txt"))
    123!
    456!
    ABC
    
    Note that grep and find differ from their Unix counterparts by requiring that the Pattern matches the entire line or file name by default. However, you can optionally match the prefix, suffix, or interior of a line:
    >>> stdout (grep (has    "2") (input "foo.txt"))
    123
    
    >>> stdout (grep (prefix "1") (input "foo.txt"))
    123
    
    >>> stdout (grep (suffix "3") (input "foo.txt"))
    123
    
    You can also build up more sophisticated Shell programs using sh in conjunction with do notation:
    {-# LANGUAGE OverloadedStrings #-}
    
    import Turtle
    
    main = sh example
    
    example = do
    -- Read in file names from "files1.txt" and "files2.txt"
    file <- fmap fromText (input "files1.txt" <|> input "files2.txt")
    
    -- Stream each file to standard output only if the file exists
    True <- liftIO (testfile file)
    line <- input file
    liftIO (echo line)
    
    See Turtle.Tutorial for an extended tutorial explaining how to use this library in greater detail.

  6. package base-prelude

    Featureful preludes formed solely from the "base" package A library which aims to reexport all the non-conflicting and most general definitions from the "base" package. This includes APIs for applicatives, arrows, monoids, foldables, traversables, exceptions, generics, ST, MVars and STM. This package will never have any dependencies other than "base". Besides a rich prelude it provides limited ones like BasePrelude.DataTypes, which only exports the data-types defined across the "base" package, and BasePrelude.Operators, which only exports the common operators. Versioning policy The versioning policy of this package deviates from PVP in the sense that its exports in part are transitively determined by the version of "base". Therefore it's recommended for the users of "base-prelude" to specify the bounds of "base" as well.

  7. module BasePrelude

    Reexports of most of the definitions from the "base" package, which it is a common practice to import unqualified. For details check out the source.

  8. module Control.CollectErrors.PreludeInstances

    No documentation available.

  9. module Numeric.CollectErrors.PreludeInstances

    No documentation available.

  10. preludeFixities :: [(String, Fixity)]

    ghc-lib-parser-ex Language.Haskell.GhclibParserEx.Fixity

    No documentation available.

Page 7 of many | Previous | Next