Sha256: 42641a65d0e71ed1c151e3d09e532dd8c0a98f02f32fed6ab09658935bda74ae

Contents?: true

Size: 463 Bytes

Versions: 242

Compression:

Stored size: 463 Bytes

Contents

module Etl
  ( transform
  ) where

import Prelude
import Data.Array (foldl)
import Data.Char (toLower)
import Data.Map (Map, insert, empty, toUnfoldable)
import Data.Tuple (Tuple(..))

transform :: Map Int (Array Char) -> Map Char Int
transform = toUnfoldable
            >>> expand
            >>> foldl add empty
  where expand xs = do
          Tuple k ys <- xs
          y <- ys
          pure $ Tuple k y
        add m (Tuple k v) = insert (toLower v) k m

Version data entries

242 entries across 242 versions & 1 rubygems

Version Path
trackler-2.2.1.119 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.118 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.117 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.116 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.115 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.114 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.113 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.111 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.110 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.109 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.108 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.107 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.106 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.105 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.104 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.103 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.102 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.101 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.100 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.99 tracks/purescript/exercises/etl/examples/src/Etl.purs