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.159 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.158 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.157 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.156 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.155 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.154 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.153 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.152 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.151 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.150 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.149 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.148 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.147 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.146 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.145 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.144 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.143 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.142 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.141 tracks/purescript/exercises/etl/examples/src/Etl.purs
trackler-2.2.1.140 tracks/purescript/exercises/etl/examples/src/Etl.purs