Hoogle Search

Within LTS Haskell 24.34 (ghc-9.10.3)

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

  1. mapE :: Expr

    code-conjure Conjure.Expr

    map over the Int element type encoded as an Expr

    > mapE
    map :: (Int -> Int) -> [Int] -> [Int]
    

  2. mapInnerFirstOuterLast :: (Expr -> Expr) -> Expr -> Expr

    code-conjure Conjure.Expr

    No documentation available.

  3. mapSubexprs :: (Expr -> Maybe Expr) -> Expr -> Expr

    code-conjure Conjure.Expr

    O(n*m). Substitute subexpressions of an expression using the given function. Outer expressions have more precedence than inner expressions. (cf. //) With:

    > let xx = var "x" (undefined :: Int)
    > let yy = var "y" (undefined :: Int)
    > let zz = var "z" (undefined :: Int)
    > let plus = value "+" ((+) :: Int->Int->Int)
    > let times = value "*" ((*) :: Int->Int->Int)
    > let xx -+- yy = plus :$ xx :$ yy
    > let xx -*- yy = times :$ xx :$ yy
    
    > let pluswap (o :$ xx :$ yy) | o == plus = Just $ o :$ yy :$ xx
    |     pluswap _                           = Nothing
    
    Then:
    > mapSubexprs pluswap $ (xx -*- yy) -+- (yy -*- zz)
    y * z + x * y :: Int
    
    > mapSubexprs pluswap $ (xx -+- yy) -*- (yy -+- zz)
    (y + x) * (z + y) :: Int
    
    Substitutions do not stack, in other words a replaced expression or its subexpressions are not further replaced:
    > mapSubexprs pluswap $ (xx -+- yy) -+- (yy -+- zz)
    (y + z) + (x + y) :: Int
    
    Given that the argument function is O(m), this function is O(n*m).

  4. mapValues :: (Expr -> Expr) -> Expr -> Expr

    code-conjure Conjure.Expr

    O(n*m). Applies a function to all terminal values in an expression. (cf. //-) Given that:

    > let zero  = val (0 :: Int)
    > let one   = val (1 :: Int)
    > let two   = val (2 :: Int)
    > let three = val (3 :: Int)
    > let xx -+- yy = value "+" ((+) :: Int->Int->Int) :$ xx :$ yy
    > let intToZero e = if typ e == typ zero then zero else e
    
    Then:
    > one -+- (two -+- three)
    1 + (2 + 3) :: Int
    
    > mapValues intToZero $ one -+- (two -+- three)
    0 + (0 + 0) :: Integer
    
    Given that the argument function is O(m), this function is O(n*m).

  5. mapVars :: (Expr -> Expr) -> Expr -> Expr

    code-conjure Conjure.Expr

    O(n*m). Applies a function to all variables in an expression. Given that:

    > let primeify e = if isVar e
    |                  then case e of (Value n d) -> Value (n ++ "'") d
    |                  else e
    > let xx = var "x" (undefined :: Int)
    > let yy = var "y" (undefined :: Int)
    > let xx -+- yy = value "+" ((+) :: Int->Int->Int) :$ xx :$ yy
    
    Then:
    > xx -+- yy
    x + y :: Int
    
    > primeify xx
    x' :: Int
    
    > mapVars primeify $ xx -+- yy
    x' + y' :: Int
    
    > mapVars (primeify . primeify) $ xx -+- yy
    x'' + y'' :: Int
    
    Given that the argument function is O(m), this function is O(n*m).

  6. mappArgs :: (Expr -> Expr) -> Expr -> Expr

    code-conjure Conjure.Expr

    No documentation available.

  7. mappFun :: (Expr -> Expr) -> Expr -> Expr

    code-conjure Conjure.Expr

    No documentation available.

  8. mapHead :: (a -> a) -> [a] -> [a]

    code-conjure Conjure.Utils

    Applies a function to the head of a list.

  9. mapEdge :: forall el0 el1 (e :: Type -> Type) n nl . (el0 -> el1) -> Graph e n el0 nl -> Graph e n el1 nl

    comfort-graph Data.Graph.Comfort

    \(TestGraph gr) -> Graph.mapEdge id gr == gr
    

  10. mapEdgeKeys :: (Edge e1, Ord n) => (e0 n -> e1 n) -> Graph e0 n el nl -> Graph e1 n el nl

    comfort-graph Data.Graph.Comfort

    Same restrictions as in mapMaybeEdgeKeys.

Page 323 of many | Previous | Next