Snipplr
http://snipplr.com/language/haskell/tags/problems
Recent snippets posted on Snipplr.comen-usSun, 29 May 2016 23:32:36 GMT(Haskell) Haskell 99 Problems - Problem 23 - rtperson
http://snipplr.com/view/58582/haskell-99-problems--problem-23/
problem 23, Extract a given number of randomly selected elements from a list.
Example:
Prelude System.Random>rnd_select "abcdefgh" 3 >>= putStrLn
"eda"
Two problems: 1) How to return a list, and 2) how to sample without duplication ]]>Sat, 10 Sep 2011 07:27:49 GMThttp://snipplr.com/view/58582/haskell-99-problems--problem-23/(Haskell) Haskell 99 Problems, numbers 1 through 9 - rtperson
http://snipplr.com/view/58509/haskell-99-problems-numbers-1-through-9/
I had originally started these problems from #10 (Run-length encoding). I went back and did 1-8 for completeness. ]]>Thu, 08 Sep 2011 00:23:54 GMThttp://snipplr.com/view/58509/haskell-99-problems-numbers-1-through-9/(Haskell) Haskell 99 Problems - Number 20, Arrowed! - rtperson
http://snipplr.com/view/58144/haskell-99-problems--number-20--arrowed/
problem 20, (*) Remove the K'th element from a list
*Main> removeAt 1 "abcd"
"acd"
Trivial using a pure function. A bit more challenging if you use this problem to work up your Arrow-fu. ]]>Thu, 25 Aug 2011 01:54:30 GMThttp://snipplr.com/view/58144/haskell-99-problems--number-20--arrowed/(Haskell) Haskell 99 Problems - Number 18 and 19 - rtperson
http://snipplr.com/view/58064/haskell-99-problems--number-18-and-19/
Problem 18: Extract a slice from a list.
Given two indices, i and k, the slice is the list containing the elements between the i'th and k'th element of the original list (both limits included). Start counting the elements with 1.
Example:
*Main> slice ['a','b','c','d','e','f','g','h','i','k'] 3 7
"cdefg
9 Problem 19 - Rotate a list N places to the left.
*Main> rotate ['a','b','c','d','e','f','g','h'] 3
"defghabc"
*Main> rotate ['a','b','c','d','e','f','g','h'] (-2)
"ghabcdef"
(This one is so easy it feels like cheating...) ]]>Sun, 21 Aug 2011 01:58:02 GMThttp://snipplr.com/view/58064/haskell-99-problems--number-18-and-19/(Haskell) Haskell 99 Problems - Number 17 - rtperson
http://snipplr.com/view/57981/haskell-99-problems--number-17/
problem 17, Split a list into two parts; the length of the first part is given.
Do not use any predefined predicates. (Meaning no splitAt or take or drop)
*Main> split "abcdefghik" 3
("abc", "defghik") ]]>Thu, 18 Aug 2011 06:50:09 GMThttp://snipplr.com/view/57981/haskell-99-problems--number-17/(Haskell) Haskell 99 Problems - Numbers 15 and 16 - rtperson
http://snipplr.com/view/57971/haskell-99-problems--numbers-15-and-16/
problem 15, Replicate the elements of a list a given number of times.
> repli "abc" 3
"aaabbbccc"
problem 16, Drop every N'th element from a list.
*Main> dropEvery "abcdefghik" 3
"abdeghk" ]]>Thu, 18 Aug 2011 03:59:30 GMThttp://snipplr.com/view/57971/haskell-99-problems--numbers-15-and-16/(Haskell) Run-Length Encoding in Haskell - rtperson
http://snipplr.com/view/57300/runlength-encoding-in-haskell/
Problem 10 of the famous 99 Problems. I got 99 problems, but a Lisp ain't one. ]]>Fri, 29 Jul 2011 06:08:49 GMThttp://snipplr.com/view/57300/runlength-encoding-in-haskell/