✅ haskell: pangram
This commit is contained in:
17
haskell/pangram/examples/success-text/package.yaml
Normal file
17
haskell/pangram/examples/success-text/package.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
name: pangram
|
||||
|
||||
dependencies:
|
||||
- base
|
||||
- text
|
||||
|
||||
library:
|
||||
exposed-modules: Pangram
|
||||
source-dirs: src
|
||||
|
||||
tests:
|
||||
test:
|
||||
main: Tests.hs
|
||||
source-dirs: test
|
||||
dependencies:
|
||||
- pangram
|
||||
- hspec
|
8
haskell/pangram/examples/success-text/src/Pangram.hs
Normal file
8
haskell/pangram/examples/success-text/src/Pangram.hs
Normal file
@ -0,0 +1,8 @@
|
||||
module Pangram (isPangram) where
|
||||
|
||||
import Data.Text (Text)
|
||||
import qualified Data.Text as T
|
||||
|
||||
isPangram :: Text -> Bool
|
||||
isPangram s = all (`member` T.toLower s) ['a'..'z']
|
||||
where member = T.any . (==)
|
Reference in New Issue
Block a user