I do stuff with Scala @ SoundCloud

I state and prove theorems of constructivist logic (proof).

I also connect points in topological spaces (proof).

My email: `(λx.folonexlambda-calcul.us)@`

There’s a lot of talks about typelevel things in Scala. “Shapeless”:shapeless has gained huge amount of attention lately. There are a lot of cool typelevel tricks out there, coined by “Miles Sabin”:milessabin, the type astonaut. Some even say, he does not exist at the runtime. Anyway, I’d like to collect some of those tricks here, for future reference. I’m also doing this to get a better understanding of those tricks. h2. Table table{border:1px solid black}. | _.Trick | _.Short description | “Unboxed Tagged Types”:taggedtypes | Something like Haskell’s “newtype”:newtype, but better. | “Dependent types”:deptypestaste | Have types depend on values | “Unapply”:unapplyorigin | Reduce needed type annotations by guiding scala’s type inference | “Ambiguous implicits”:ambigimplicitsml | A way to guarantee that a polymorphic function will not return some specific type | h2. Unboxed Tagged Types There’s already a great explanation, including the needed intuition, in “Eric Torreborre’s blog”:taggedtypes. This technique allows for having some typelevel guarantees on the values. Here’s a motivating example. Say, you want to create a function, which operates on positive doubles. Here’s how you could go about this: It’s a totally ok way to do this, but imagine, you want several such functions, and you want to chain them afterwards. You might create something like |

- Typelevel hackery tricks in Scala ( Mar 2013 )
- Uniqueness types in Scala ( Feb 2013 )
- What will programming look like in 2020 -- my personal wishlist ( Jan 2013 )
- Best of the 2012 ( Jan 2013 )
- Exercises on implementing Reader, Writer and State monads in Scala ( Oct 2012 )