Add Haskell subSequences (#121)
* Add Haskell Sequence * Add type signature for the function * Add aim of sequence.hs program Co-authored-by: Arsenic <54987647+Arsenic-ATG@users.noreply.github.com>pull/125/head
parent
098eed7b6c
commit
d1c691d684
|
@ -34,5 +34,6 @@
|
|||
|
||||
### Haskell
|
||||
|
||||
1. [Palin Check](haskell/palindrome.hs)
|
||||
1. [Palindrome Check](haskell/palindrome.hs)
|
||||
2. [All subsequences](haskell/sequence.hs)
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
-- program to generate all subsequences of a sequence
|
||||
|
||||
import Control.Monad (filterM)
|
||||
|
||||
findSubSequences :: String -> [String]
|
||||
findSubSequences = filterM $ const [True, False]
|
||||
|
||||
main = traverse print $ findSubSequences "abc"
|
Loading…
Reference in New Issue