Sha256: b621925b310055b6cf0377c30737780f2b5568420e19587d78f73dfb1d77f1d1

Contents?: true

Size: 422 Bytes

Versions: 322

Compression:

Stored size: 422 Bytes

Contents

module Anagram exposing (..)

import String exposing (toLower, toList)


detect : String -> List String -> List String
detect word candidates =
    let
        original =
            toLower word

        ref =
            normalize word
    in
        List.filter (\w -> normalize w == ref && toLower w /= original) candidates


normalize : String -> List Char
normalize word =
    word |> toLower |> toList |> List.sort

Version data entries

322 entries across 322 versions & 1 rubygems

Version Path
trackler-2.2.1.104 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.103 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.102 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.101 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.100 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.99 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.98 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.97 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.96 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.95 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.94 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.93 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.92 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.91 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.90 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.89 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.88 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.87 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.86 tracks/elm/exercises/anagram/Anagram.example.elm
trackler-2.2.1.85 tracks/elm/exercises/anagram/Anagram.example.elm