inside the GHC code generator
Lemmih
lemmih at gmail.com
Fri Feb 24 12:55:37 EST 2006
On 2/24/06, Bulat Ziganshin <bulat.ziganshin at gmail.com> wrote:
> Hello Lemmih,
>
> Friday, February 24, 2006, 1:15:51 PM, you wrote:
>
> >> clean differs from Haskell in support of unique types and strictness
> >> annotations. the last is slowly migrates into GHC in form of shebang
> >> patters, but i think that it is a half-solution. i mentioned in
> >> original letter my proposals to add strictness annotations to
> >> function types declarations and to declare strict datastructures, such
> >> as "![Int]"
>
> L> As I've understood it, Clean's strictness annotations are a bit of a
> L> hack which only works on certain built-in types. Am I mistaking here?
>
> i don't know Clean very well, although i've seen rumors that it
> supports strict datastructures. after all, this don't need changes in
> language itself, it's just a syntax sugar:
>
> data [a] = [] | a:[a]
> x :: ![Int]
>
> translates to the
>
> data StrictList a = Nil | Cons a !(StrictList a)
> x :: !(StrictList a)
Let's try this:
x :: ![Int] -> Int
It would translate to something like this:
mkStrictList :: [a] -> StrictList a
x = xStrict . mkStrictList
xStrict = ...
Wouldn't it be very expensive to strictify the list?
--
Friendly,
Lemmih
More information about the Glasgow-haskell-users
mailing list