Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benclifford/acme-smuggler
Smuggle arbitrary values in ()
https://github.com/benclifford/acme-smuggler
haskell joke satans-values
Last synced: 5 days ago
JSON representation
Smuggle arbitrary values in ()
- Host: GitHub
- URL: https://github.com/benclifford/acme-smuggler
- Owner: benclifford
- License: bsd-3-clause
- Created: 2016-12-11T10:25:01.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-04-18T16:14:08.000Z (over 1 year ago)
- Last Synced: 2024-03-14T16:04:51.752Z (8 months ago)
- Topics: haskell, joke, satans-values
- Language: Haskell
- Homepage:
- Size: 11.7 KB
- Stars: 12
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ACME Smuggler
=============The `()` type has only one value, also called `()` with no
internal structure.Nevertheless, acme-smuggler allows you to smuggle
arbitrary values into `()` and discover them later.```haskell
> x = smuggle "hello"
> :t x
x :: ()> y = smuggle (7 :: Integer)
> :t y
y :: ()> discover x :: Maybe String
Just "hello"
> discover y :: Maybe Integer
Just 7
> discover x :: Maybe Integer
Nothing
```And! `Void` has no values at all, but acme-smuggler even lets you
smuggle values into `Void`. Or into any other Haskell type.Here are slides for a short talk that I gave at the London Haskell User Group:
http://www.hawaga.org.uk/ben/tech/london-hug-acme-smuggler/presentation.html
and my original blog post:
http://benctechnicalblog.blogspot.com/2016/11/smuggling-things-in-dirty-bottom.html## History
acme-smuggler originated in a workaround for an issue @tdietert and I had
with the JuicyPixels library, https://github.com/Twinside/Juicy.Pixels/issues/128