as Thomas pointed out off-list, the transformation sequence as given
is not type-preserving. i even documented that problem in my email,
because i thought the type was dodgy, but forgot to track it down
before posting. so here are the changes. a good demonstration that
"does it still compile?
On 7/16/07, Claus Reinke <[EMAIL PROTECTED]> wrote:
enjoy (i hope:-),
Very much. Work hasn't been so much fun since Well, for a long time. :-)
One small question, which might reveal if I've understood things aright.
(do (v,e) <- dmin' l
(do guard e
me
Everyone's suggestions show that in order to advance to a level 3
Haskell Mage[*], I need to spend a chunk of time learning to grok
monad transformers.
let's see whether we can get from the initial version to the suggested
final version without any magic, in a somewhat long sequence of
minor r
On 7/15/07, Miguel Mitrofanov <[EMAIL PROTECTED]> wrote:
[nice solution deleted]
Shiny.
Everyone's suggestions show that in order to advance to a level 3
Haskell Mage[*], I need to spend a chunk of time learning to grok
monad transformers.
Thanks for the suggestions. If anyone cares I can po
TC> dmin p = do
TC> mv <- dmin' p
TC> case mv of
TC> Nothing -> error "dmin: no values"
TC> Just (v,_) -> return v
TC> dmin' p = do
TC> t <- readTVar p
TC> case t of
TC> Empty -> return Nothing
TC> Trie l m r -> do
TC> mv <- dmin' l
TC>
G'day.
One small suggestion.
Quoting Thomas Conway <[EMAIL PROTECTED]>:
> Just (v,e) -> do
> case e of
> True -> [...]
> False -> [...]
This works just as well:
Just (v,True) -> [...]
Hello Thomas,
Saturday, July 14, 2007, 12:59:16 AM, you wrote:
> case re of
> False -> writeTVar m Nothing
> True -> writeTVar p Empty
> All that case analysis causes indentation to creep, and lots of
>
In addition to what's already been pointed out, note that this:
> do t <- readTVar p
> case t of
> Empty -> return Nothing
> Trie l m r -> do
Is a case of the (non-existent) MaybeT transformer:
> do Trie l m r <- readTVar p
>
The modifications being something like 'ret
is there Haskellmagic that I still need to learn?
one bit of magic, coming right up!-) of course, we haskellers are
the lazy types, and if none of that helps, some Monad often does.
in ghci or hugs, try ':browse Data.Maybe' and ':info Maybe'.
in particular, 'case . of Nothing -> . ; Just . -
On Jul 13, 2007, at 18:56 , Brandon S. Allbery KF8NH wrote:
> return (isJust v)
*blush* Invert that, of course: isNothing v
--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and compu
On Jul 13, 2007, at 16:59 , Thomas Conway wrote:
case re of
False -> writeTVar m Nothing
True -> writeTVar p Empty
> uncurry writeTVar $
> if re then (p,Empty) else (m,Nothing)
case v of
Hi
In particular, I wrote a Trie implementation.
Neat, I often feel I should be using one of those, but never do
because Data.Map is just too temptingly close by.
A couple of the combinators can be used to simplify some bits:
case v of
Nothing -> return True
12 matches
Mail list logo