Hoogle Search

Within LTS Haskell 24.40 (ghc-9.10.3)

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

  1. 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).

  2. 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).

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

    code-conjure Conjure.Expr

    No documentation available.

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

    code-conjure Conjure.Expr

    No documentation available.

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

    code-conjure Conjure.Utils

    Applies a function to the head of a list.

  6. 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
    

  7. 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.

  8. mapEdgeWithKey :: (e n -> el0 -> el1) -> Graph e n el0 nl -> Graph e n el1 nl

    comfort-graph Data.Graph.Comfort

    No documentation available.

  9. mapKeys :: (Edge edge1, Ord node0, Ord node1) => (node0 -> node1) -> (edge0 node0 -> edge1 node1) -> Graph edge0 node0 edgeLabel nodeLabel -> Graph edge1 node1 edgeLabel nodeLabel

    comfort-graph Data.Graph.Comfort

    The index map must be an injection, that is, nodes must not collaps. Also the node and edge index maps must be consistent, i.e.

    from (edgeMap e) == nodeMap (from e)
    to   (edgeMap e) == nodeMap (to   e)
    
    Strictly spoken, we would need the node map only for isolated nodes, but we use it for all nodes for simplicity.

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

    comfort-graph Data.Graph.Comfort

    You may only use this for filtering edges and use more specialised types as a result. You must not alter source and target nodes of edges.

Page 324 of many | Previous | Next