Re: Evaluating type expressions in GHCi

2011-09-20 Thread Brent Yorgey
On Tue, Sep 20, 2011 at 04:29:21PM -0700, J. Garrett Morris wrote: > On Tue, Sep 20, 2011 at 3:44 PM, Simon Peyton-Jones > wrote: > > What should the GHCi command be *called*? > > :simplify or :simplifytype. In GHCi at the moment, you could abbreviate > that as short as :si. IMO Simon's suggest

Re: Evaluating type expressions in GHCi

2011-09-20 Thread Daniel Fischer
On Wednesday 21 September 2011, 01:02:52, wagne...@seas.upenn.edu wrote: > Would it be possible to have no command at all? Types are > distinguished by upper-case letters, so it should be possible to tell > whether a given expression is a value-level or a type-level expression. Unless I'm misu

Re: Evaluating type expressions in GHCi

2011-09-20 Thread J. Garrett Morris
On Tue, Sep 20, 2011 at 3:44 PM, Simon Peyton-Jones wrote: > What should the GHCi command be *called*? :simplify or :simplifytype. In GHCi at the moment, you could abbreviate that as short as :si. /g -- "I’m surprised you haven’t got a little purple space dog, just to ram home what an interg

Re: Evaluating type expressions in GHCi

2011-09-20 Thread Dan Doel
type family Bar a :: * type instance Bar () = String data Foo a = Bar a | Baz a a ghci> Bar () What happens? There is a lot of ambiguity between term and type levels in Haskell. (,); []; etc. It's only the overall structure of the language that disambiguates them; you can't necessarily tell jus

RE: Evaluating type expressions in GHCi

2011-09-20 Thread wagnerdm
Would it be possible to have no command at all? Types are distinguished by upper-case letters, so it should be possible to tell whether a given expression is a value-level or a type-level expression. I guess that's not strictly true, since the expression could be _only_ type variables -- bu

RE: Evaluating type expressions in GHCi

2011-09-20 Thread Simon Peyton-Jones
Sean Yes, this has been asked for before, and it wouldn't be hard to implement. What should the GHCi command be *called*? We already have :kind, which displays the kind of a type. Maybe :kind! should evaluate the type as well? Or perhaps :kind should evaluate anyway (although that would be

Evaluating type expressions in GHCi

2011-09-20 Thread Sean Leather
I would like to ask GHCi for the type that a type expression will evaluate to, once all definitions of type synonyms and (when possible) type families have been inlined. It appears that I can do some part of this for type T by using ":t undefined :: T": type family F a type instance F Int = Bool

Re: deep record update

2011-09-20 Thread Julian Bean
This is (a) one of the big advantages of records and (b) why it's a mistake to have the record discussion without taking into account some notion of lens. Haskell field names are a red herring because they're selector functions - what we need is a record system which generates lenses and solves