Thanks everyone, this is all good stuff.
I did look at Clean and it looks like it has somewhat nicer record
syntax... but it doesn't look like anything haskell couldn't do better
if it one day got a real record system. As for the rest of Clean, I'm
afraid that spending too much time with it will
On Tue, Apr 22, 2008 at 6:26 AM, Henning Thielemann
<[EMAIL PROTECTED]> wrote:
> On Mon, 21 Apr 2008, Ryan Ingram wrote:
> > I recommend this blog entry:
> >
> http://twan.home.fmf.nl/blog/haskell/overloading-functional-references.details
> >
> > along with a few additional combinators for imperat
On Mon, 21 Apr 2008, Ryan Ingram wrote:
I recommend this blog entry:
http://twan.home.fmf.nl/blog/haskell/overloading-functional-references.details
along with a few additional combinators for imperative update:
data FRef s a = FRef
{ frGet :: s -> a
, frSet :: a -> s -> s
}
http://dar
On Tue, Apr 22, 2008 at 4:12 AM, Evan Laforge <[EMAIL PROTECTED]> wrote:
> Has there been any work on improving update syntax in haskell?
> Possibly some improvement could be made with a typeclass or two and a
> few custom operators, to unify some of the disparate syntax. Maybe
> more improvem
I recommend this blog entry:
http://twan.home.fmf.nl/blog/haskell/overloading-functional-references.details
along with a few additional combinators for imperative update:
data FRef s a = FRef
{ frGet :: s -> a
, frSet :: a -> s -> s
}
(=:) :: MonadState s m => FRef s a -> a -> m ()
ref
Here's some haskell to update a particular field in a data structure
(the below run in a StateT / ErrorT context):
> set_track_width :: (UiStateMonad m) =>
> Block.ViewId -> Int -> Block.Width -> m ()
> set_track_width view_id tracknum width = do
> view <- get_view view_id
> track_view