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.180 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.179 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.178 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.177 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.176 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.175 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.174 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.173 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.172 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.171 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.170 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.169 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.167 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.166 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.165 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.164 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.163 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.162 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.161 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.160 tracks/purescript/exercises/etl/examples/src/Etl.purs