September meeting

39 views
Skip to first unread message

dann toliver

unread,
Sep 15, 2016, 6:47:01 PM9/15/16
to Toronto Haskell User Group
Hello, Haskell people!

This month we're diverging slightly from our regular schedule (first Wednesday after the third Tuesday after the changing of months in the Gregorian calendar) to instead meet on the last Wednesday of the month, September 28. 

We'll be occupying the same physical space as usual, specifically the Gamma Space, formerly known as Bento Miso. We will begin around 6:30 or possibly earlier or maybe a few minutes later. Beginnings are often ambiguous.

If you have topics in mind feel free to mention them on this mailing list, though you can also surprise us at the meeting. 

Looking forward to seeing you there!

Dann

P.S. There is at least one error in the description of the regular schedule, which may provide fodder for conversation at the meeting. Because time is hard. Let's go shopping.

Yawar Amin

unread,
Sep 17, 2016, 7:32:40 PM9/17/16
to Toronto Haskell User Group
Hi Dann, I would like to attend (I'm new to the group). Do I need to register somewhere?

Thanks,

Yawar

dann

unread,
Sep 17, 2016, 9:19:15 PM9/17/16
to toronto...@googlegroups.com
Hi Yawar,

All are welcome to attend, no need to register. 

Here's the web site for the space we're meeting at: https://bentomiso.com

See you on the 28th!

Dann


--
You received this message because you are subscribed to the Google Groups "Toronto Haskell User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to toronto-haske...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yawar Amin

unread,
Sep 18, 2016, 1:28:26 PM9/18/16
to toronto...@googlegroups.com
Thanks! I'm looking forward to it. And kicking myself a little that I hadn't thought to look for Haskell meetups in Toronto :-)

To unsubscribe from this group and stop receiving emails from it, send an email to toronto-haskell+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Toronto Haskell User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/toronto-haskell/hLy6cBugVXM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to toronto-haskell+unsubscribe@googlegroups.com.

Boris Rozinov

unread,
Sep 21, 2016, 9:37:01 AM9/21/16
to Toronto Haskell User Group
Hi Dann,

My I suggest as topic some introduction to type level programming: GADT, DataKinds , type families, etc.

Boris

dann

unread,
Sep 21, 2016, 3:17:39 PM9/21/16
to toronto...@googlegroups.com
Those sound like great topics!

Thanks,
Dann


--
You received this message because you are subscribed to the Google Groups "Toronto Haskell User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to toronto-haske...@googlegroups.com.

Yawar Amin

unread,
Sep 25, 2016, 2:14:54 PM9/25/16
to toronto...@googlegroups.com
A heads-up from me: I plan on asking about setting up a Haskell IDE-like environment, with things like displaying the type of a selected symbol, jumping to definition, etc. So far I've tried a few things but nothing has been too reliable. So I'm looking forward to seeing if anyone has got a good setup!

On Wed, Sep 21, 2016 at 3:17 PM, dann <00d...@gmail.com> wrote:
Those sound like great topics!

Thanks,
Dann


On Sep 21, 2016, at 9:37, Boris Rozinov <sip...@gmail.com> wrote:

Hi Dann,

My I suggest as topic some introduction to type level programming: GADT, DataKinds , type families, etc.

Boris

--
You received this message because you are subscribed to the Google Groups "Toronto Haskell User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to toronto-haskell+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Toronto Haskell User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/toronto-haskell/hLy6cBugVXM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to toronto-haskell+unsubscribe@googlegroups.com.

Rudi Grinberg

unread,
Sep 25, 2016, 4:16:46 PM9/25/16
to toronto...@googlegroups.com
Most of us (perhaps all?) at the meetup are emacs or spacemacs of some sorts.
So we should be able to show how our setups work.

The most usable approach today seems to be to use use intero. Otherwise, ghc-mod
is still reliable although a pain to setup. Especially if you use stack.

Cheers,

Rudi.

On 09/25, Yawar Amin wrote:
>A heads-up from me: I plan on asking about setting up a Haskell IDE-like
>environment, with things like displaying the type of a selected symbol,
>jumping to definition, etc. So far I've tried a few things but nothing has
>been too reliable. So I'm looking forward to seeing if anyone has got a
>good setup!
>
>On Wed, Sep 21, 2016 at 3:17 PM, dann <00d...@gmail.com> wrote:
>
>> Those sound like great topics!
>>
>> Thanks,
>> Dann
>>
>>
>> On Sep 21, 2016, at 9:37, Boris Rozinov <sip...@gmail.com> wrote:
>>
>> Hi Dann,
>>
>> My I suggest as topic some introduction to type level programming: GADT,
>> DataKinds , type families, etc.
>>
>> Boris
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Toronto Haskell User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to toronto-haske...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Toronto Haskell User Group" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/
>> topic/toronto-haskell/hLy6cBugVXM/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> toronto-haske...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>--
>You received this message because you are subscribed to the Google Groups "Toronto Haskell User Group" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to toronto-haske...@googlegroups.com.

Rudi Grinberg

unread,
Sep 26, 2016, 2:03:30 PM9/26/16
to toronto...@googlegroups.com
Excellent choice of topic. I have a couple of specific curiousities about these
subjects as well.

1) I know GADTs can be faked with the finally tagless construction using higher
rank types. It was discussed in a pretty blog post a while ago but I never quite got it:

http://www.haskellforall.com/2012/06/gadts.html

2) the difference between data families and GADTs. This discussion left an
impression on me:

https://www.reddit.com/r/haskell/comments/4tiwvj/gadt_vs_data_families_in_practice/

But there is still some lingering confusion.

Rudi.

Boris Rozinov

unread,
Sep 27, 2016, 5:29:05 PM9/27/16
to Toronto Haskell User Group
I found this article quite amazing: https://www.well-typed.com/blog/2015/11/implementing-a-minimal-version-of-haskell-servant/ 
It gives some practical example of using few concepts (data kinds, type families, type level string and more) along with introduction to Servant package,

Suhail Shergill

unread,
Sep 28, 2016, 7:07:49 AM9/28/16
to Toronto Haskell User Group
a few things:

- GADTs allow a manner of "type casing". specifically, in a language which has universal quantification as default it allows you to select types by matching on data constructors. so, GADTs provide a lookup mechanism of sorts where the keys are constructors and the values are types (in the constructed value). this is useful when you are trying to embed a DSL in a typed host language, to ensure the embedding is "tight". i.e., GADTs allow us to have more precise types.

- in tagless final approach, DSLs are modelled using functions and typeclasses (as opposed to via datatypes). so the equivalent to the GADT capability would be the ability to have a lookup mechanism where the keys are functions and the values are types. i.e., we can identify/narrow types based on the function name. well, for typeclasses this is just business as usual. it's in this manner that tagless final approach can allow us to model GADTs. more accurately, in the tagless final approach you don't need the power of GADTs to have a tight embedding of a typed DSL in a typed host language.

http://www.haskellforall.com/2012/06/gadts.html shows a way to model some capabilities of GADTs via yoneda lemma (which is glorified eta equivalence... of sorts). the idea behind that is simple: since GADTs are glorified ways to lookup types, let's make that explicit and parametrize on that. however, this doesn't get you all the way there (as can be seen in the blog post).

hope that helps.

Boris Rozinov

unread,
Sep 28, 2016, 3:25:24 PM9/28/16
to Toronto Haskell User Group
For me personally it would be great if we can make today discussion as more introductory and ideally explore more in the following meetups .

Yawar Amin

unread,
Sep 28, 2016, 4:03:05 PM9/28/16
to toronto...@googlegroups.com
Folks, unfortunately I won't be able to make it this evening as I've come down with the annual cold+flu. On GADTs, I think the key point to take from Suhail's reply is they let you tighten up your types and provide more guarantees at compile time. Here is a neat example: http://stackoverflow.com/a/19464707/20371

Regards,

Yawar

--
You received this message because you are subscribed to a topic in the Google Groups "Toronto Haskell User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/toronto-haskell/hLy6cBugVXM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to toronto-haskell+unsubscribe@googlegroups.com.

Rudi Grinberg

unread,
Sep 28, 2016, 4:27:34 PM9/28/16
to toronto...@googlegroups.com
Thanks for the response - really helpful.

One thing I'd like to clarify is the need for type classes in the tagless final
approach. Why exactly do you need type classes at all? Seems like instance
selection doesn't play much of a role here, so why can't you just use a record
of functions for your final encoding? and pass it manually of course.
>> email to toronto-haske...@googlegroups.com <javascript:>.

Suhail Shergill

unread,
Sep 28, 2016, 7:00:04 PM9/28/16
to toronto...@googlegroups.com

You can certainly pass the dictionary manually via a value level data record. If you do that you no longer get automatic instance selection.
For better or for worse, when you use typclasses in tagless final you get the property that changing the types allows you to change the semantics of the program.


You received this message because you are subscribed to a topic in the Google Groups "Toronto Haskell User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/toronto-haskell/hLy6cBugVXM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to toronto-haske...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--

Cheers
--
Suhail

Rudi Grinberg

unread,
Sep 30, 2016, 1:16:12 PM9/30/16
to toronto...@googlegroups.com
This is a question mostly to Albert (but anyone else who remembers might can
answer):

In our last meeting, we had that difference list with the show instance. But I
forgot how we actually wrote the instance. Does anyone remember the details?

This is what I have:

data L :: * -> * -> * where
Nil :: L a a
Cons :: (Show a) => a -> L ty v -> L (a -> ty) v

instance Show a => Show (L a b) where
show Nil = "[]"
show (Cons x xs) = show x ++ ":" ++ show xs

But it doesn't compile...

Albert Y. C. Lai

unread,
Sep 30, 2016, 2:21:10 PM9/30/16
to toronto...@googlegroups.com
On 2016-09-30 01:16 PM, Rudi Grinberg wrote:
> instance Show a => Show (L a b) where

Change that to: instance Show (L a b) where

Rudi Grinberg

unread,
Sep 30, 2016, 2:54:38 PM9/30/16
to toronto...@googlegroups.com
Thanks Albert!

By the way, the original author of the difference list blog post showed me how
to write a general Show instance. Although we now need yet another benign GHC
extension. Perhaps you will find this useful, and hopefully you might be able to
think of a way to do it without IncoherentInstances.

{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE IncoherentInstances #-}

data L :: * -> * -> * where
Nil :: L a a
Cons :: a -> L ty v -> L (a -> ty) v

instance Show (L r r) where
show Nil = "[]"

instance (Show a, Show (L b r)) => Show (L (a -> b) r) where
show Nil = "[]"
show (Cons x xs) = show x ++ ":" ++ show xs

Suhail Shergill

unread,
Sep 30, 2016, 3:50:51 PM9/30/16
to toronto...@googlegroups.com
IncoherentInstances isn't exactly benign, fwiw

You received this message because you are subscribed to a topic in the Google Groups "Toronto Haskell User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/toronto-haskell/hLy6cBugVXM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to toronto-haske...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--

Cheers
--
Suhail

Reply all
Reply to author
Forward
0 new messages