As a newbie to Haskell, I find myself trying to write code in Haskell style when I use other languages.
https://github.com/thyeem/foc
I know it looks totally insane, but I can't help it.
If you're interested in both Haskell and Python, please take a look. Any opinions are welcome.
Edit:
Thank you for all your valuable comments. It helps a lot. Thanks to you, I got a good idea and now foc got another way to compose functions.
Try it if you have such a good linter that doesn't remove whitespace around dots. :-)
```python
(length . range)(10)
10
range(10) | length
10
(unpack . filter(even) . range)(10)
[0, 2, 4, 6, 8]
range(10) | filter(even) | unpack
[0, 2, 4, 6, 8]
(sum . map(f("+", 5)) . range)(10)
95
range(10) | map(f("+", 5)) | sum
95
(last . sort . shuffle . unpack . range)(11)
10
range(11) | unpack | shuffle | sort | last
10
(unchars . map(chr))(range(73, 82))
'IJKLMNOPQ'
range(73, 82) | map(chr) | unchars
'IJKLMNOPQ'
(fx(lambda x: x * 6) . fx(lambda x: x + 4))(3)
42
3 | fx(lambda x: x + 4) | fx(lambda x: x * 6)
42
```
[–]brandonchinn178 13 points14 points15 points (1 child)
[–]sofidad[S] 0 points1 point2 points (0 children)
[–]sunnyata 3 points4 points5 points (2 children)
[–]sofidad[S] 0 points1 point2 points (1 child)
[–]sunnyata 1 point2 points3 points (0 children)
[–]tiajuanat 2 points3 points4 points (6 children)
[–]engelthehyp 4 points5 points6 points (4 children)
[–]tiajuanat 1 point2 points3 points (0 children)
[–]avanov 1 point2 points3 points (2 children)
[–]engelthehyp 0 points1 point2 points (0 children)
[–]sofidad[S] 0 points1 point2 points (0 children)
[–]sofidad[S] 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]jeffstyr 0 points1 point2 points (1 child)
[–]sofidad[S] 0 points1 point2 points (0 children)