Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phadej/idioms-plugins
Hack idiom-brackets using GHC Source Plugin (8.6+)
https://github.com/phadej/idioms-plugins
Last synced: about 21 hours ago
JSON representation
Hack idiom-brackets using GHC Source Plugin (8.6+)
- Host: GitHub
- URL: https://github.com/phadej/idioms-plugins
- Owner: phadej
- Created: 2018-07-06T11:43:15.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-07T12:50:53.000Z (over 6 years ago)
- Last Synced: 2024-11-11T00:42:39.633Z (about 2 months ago)
- Language: Haskell
- Size: 8.79 KB
- Stars: 25
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# idioms-plugin
Hack idiom-brackets using Source Plugin.
As nobody (?) writes their lists as `([1, 2, 3])`, we can steal that syntax!
```haskell
{-# OPTIONS -fplugin=IdiomsPlugin #-}module Main (main) where
main :: IO ()
main = do
-- Just "foobar"
print ([ mappend (Just "foo") (Just "bar") ])
-- Nothing
print ([ const (Just "foo") Nothing ])
-- Just 3
print ([ (+) (Just 1) (Just (2 :: Int)) ])
```