FPB meetup 1 addendum

13 views
Skip to first unread message

Matej Kollar

unread,
Jul 12, 2015, 6:04:47 PM7/12/15
to fpb...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello all.

I would like to elaborate on two things mentioned on the last meetup.

Real world example of phantom type usage
- -----------------------------------------

I have recently found interesting example of phantom types usage:
[The path package](http://hackage.haskell.org/package/path)
with nice [motivation explanation](http://chrisdone.com/posts/path-package).
Phantom types are used there to differentiate absolute/relative paths
and files/directories.

GADTs and pattern match exhaustiveness
- --------------------------------------

On the last meetup I have shown
[example](http://fpbrno.github.io/fpb-1/fpb-1.html#%2813%29)
where compiler was complaining about non-exhaustive pattern
match on GADT while there were no more cases to cover.
And I have suggested that it might be possible to fix this.

Even though there is effort to improve this (for example
<https://ghc.haskell.org/trac/ghc/ticket/595> and probably more),
the issue seems to be a little more complicated. Some info can be found
in <http://research.microsoft.com/en-us/um/people/simonpj/papers/pattern-matching/gadtpm.pdf>
and <http://www.math.nagoya-u.ac.jp/~garrigue/papers/gadtspm.pdf>.

Matej
- --
\f.(\x.f(xx))(\x.f(xx))
(lambda f: (lambda x: lambda: f(x(x)))(lambda x: lambda: f(x(x))))
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJVouR7AAoJEGakg7kpYMYb7IoP/1soXpGKFyINsQwuhYZVVB0F
4vndKb582pMLmgntkDD7wWfe0IGVQWPqklpsMQBvfVn0gYPx1rq10NQeDt+BLk3z
cu8clL5RAxfCLIFlClzQsaHdM7p9tZK5xkmmUrYY4I3Vik1W43UtUX6dHbCmBuG2
lFopxUS4xqfjExvWvugQYG2/hRzywS7gLlGENGfv0SMdvxzCu1XEJkt34k3NwSca
ZLkcpjOYgM4DdHz+NG37e3phF1cSybm9nPKulvnvp3QqNjDzunZ4VYv1zgsd06HG
lazz+6TBremxSJrj0bHO1sJ6tCSH18cun7/HQKQZiv3C9QF00frJazSAFhKmpBr7
YKVKCHm7KOpWZH2JEIDAyShKtHhN/G2rs9XPTtLe2s0ZFJMmdQ03to0FGOJ5u5TP
260RfoJMZrmgnZByoJiEmux4Zqx9Xdzcbr9dBMk50e8srmHTk7A6IH6YOuXjT/Mq
8FjmIghm8X4F+3wW0nES+2gQiOwIsdcZHHUPwrdSojw+yXixN2cZFdqR1cGDxahY
C6wXyAcJ1wU/Zvcmqc5iiJoy1FN9FNdAZ8BLuzAZ5F4mYF9l4mOtHqS5kO+3Cg7u
Whp+hje6n0RYRk0JikVe2Hr8Seqq/RKwaO50fLW50ljmhZfVvkjwaVjZZb+7WhUU
VhhzzX1rxyArwDQOKL0w
=kI54
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages