* Petr Pudlák <[email protected]> [2013-02-25 14:02:28+0100]
> 2013/2/25 Michael Snoyman <[email protected]>
> 
> >
> > At that point, we've now made two changes to REWRITE rules:
> >
> > 1. They can takes a new ALWAYS parameters.
> > 2. There's a new, special identifier currentLocation available.
> >
> > What would be the advantage is of that approach versus introducing a
> > single new REWRITE_WITH_LOCATION pragma?
> >
> 
> Just a remark: 'currentLocation' is not a function (it's a special keyword)
> but behaves like one - it returns some kind of value. But it's not
> referentially transparent - it returns a different value depending on where
> it's used. This is something that I really don't expect from Haskell.  So
> having it return `IO Location` seems therefore much better option. And if
> someone really wants to get the location as a pure value, (s)he can simply
> wrap it with `unsafePerformIO`, which signals code readers to be careful
> with that part.

Wrapping it in IO doesn't make it any more referentially transparent, if
you think about it.

Roman

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to