Sha256: c82e4054790fedf3af7ea7ccb60568b8c21ece7b6b585695268171fa95f8be5e

Contents?: true

Size: 425 Bytes

Versions: 396

Compression:

Stored size: 425 Bytes

Contents

module Anagram

open System

let normalize (str:string) = new string(str.ToLowerInvariant().ToCharArray() |> Array.sort)    
let unequal str other = not (String.Equals(str, other, StringComparison.InvariantCultureIgnoreCase))
       
let anagrams sources target = 
    let normalizedTarget = normalize target
    let isMatch str = normalize str = normalizedTarget && unequal str target
    
    List.filter isMatch sources

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.179 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.178 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.177 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.176 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.175 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.174 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.173 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.172 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.171 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.170 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.169 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.167 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.166 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.165 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.164 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.163 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.162 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.161 tracks/fsharp/exercises/anagram/Example.fs
trackler-2.2.1.160 tracks/fsharp/exercises/anagram/Example.fs