Hello Günther,
Saturday, July 4, 2009, 3:11:23 AM, you wrote:
> I've got an IO action, some file system IO, traversing one level only and
> iterating over files found. I wish to build in an "early" exit, ie. if an
> IO action in the loop encounters a particular value I want it to abort the
> loop
Good evening, all, I wonder if I could tap your collective wisdom
regarding space leaks? I've been messing about with haskeem, my little
scheme interpreter, and I decided to see if I could make it run
reasonably space-efficiently. So far... no.
Here's what I tried: I wrote a tiny scheme program to
2009/7/4 Jason Dusek :
> 2009/07/03 George Pollard :
>> Also, throw out `map`. ;)
>
> What is the proper name for the operation on functions of a
> functor, anyway? The name `fmap` seems to driven by an analogy
> with `map`.
This is getting a little off topic, but I don't believe it has a name.
On Fri, Jul 3, 2009 at 10:17 PM, Jason Dusek wrote:
> 2009/07/03 George Pollard :
>> This discussion points to a wider issue: at some stage we
>> should look at pulling all the nice "new" stuff into Haskell
>> prelude. I'm looking at you, Data.Foldable,Traversable.
>>
>> Also, throw out `map`. ;)
>
2009/07/03 George Pollard :
> This discussion points to a wider issue: at some stage we
> should look at pulling all the nice "new" stuff into Haskell
> prelude. I'm looking at you, Data.Foldable,Traversable.
>
> Also, throw out `map`. ;)
What is the proper name for the operation on functions of
Günther Schmidt wrote:
Hi,
I've got an IO action, some file system IO, traversing one level only
and iterating over files found. I wish to build in an "early" exit, ie.
if an IO action in the loop encounters a particular value I want it to
abort the loop.
Now so far, pls don't shoot, I hav
This discussion points to a wider issue: at some stage we should look
at pulling all the nice "new" stuff into Haskell prelude. I'm looking
at you, Data.Foldable,Traversable.
Also, throw out `map`. ;)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.or
Kim-Ee Yeoh wrote:
> > type VarCount = int
> > newtype Y b a = Y {unY :: VarCount -> (b, VarCount)}
>
Hi Edward,
Your runPretty version fits the bill nicely, thank you. I might still retain
the state monad version because it allows generalizations beyond
pretty-printing.
As for fixing the origi
Achim Schneider wrote:
> As for how to express it in code: I'd recommend a combination of a
> State monad to track the indentation, and the underused[1] Applicative
> interpretation of lists to concatenate stuff. >>= would function as
> concatenation of lines, getting the state, while the indent
On Fri, Jul 3, 2009 at 6:45 PM, John Ky wrote:
> Hi,
>
> Currently I'm pretty printing code by building arrays of strings and calling
> indent. For example:
>
> instance JavaPrintableNamed AST.EnumeratedType where
> javaLinesNamed parentName (AST.EnumeratedType memberDefinitions) =
> [ "p
John Ky wrote:
> Hi,
>
> Currently I'm pretty printing code by building arrays of strings and
> calling indent. For example:
>
> instance JavaPrintableNamed AST.EnumeratedType where
>javaLinesNamed parentName (AST.EnumeratedType memberDefinitions) =
> [ "public enum " ++ asJavaId(par
Couldn't resist taking the bait...
> Well, continuations come from Scheme, and by and large, they are usually
> used in languages like Scheme (i.e. PLT web server), or Smalltalk (Seaside
> web server),
>
For a fuller history of continuatios, please see "The Discoveries of
Continuations" by John Re
Hi,
Currently I'm pretty printing code by building arrays of strings and calling
indent. For example:
instance JavaPrintableNamed AST.EnumeratedType where
javaLinesNamed parentName (AST.EnumeratedType memberDefinitions) =
[ "public enum " ++ asJavaId(parentName)
, "{"
] ++ m
Here's some code I wrote the other day:
hasCycle :: (Applicative m, MonadIO m) => Node -> m Bool
hasCycle n0 = runContT (*callCC* go) return
where
go *abort* = do visit [] IM.empty n0
return False
where
visit preds h n = do
nid <- nodeId n
h' <- foldM (
Well, continuations come from Scheme, and by and large, they are usually
used in languages like Scheme (i.e. PLT web server), or Smalltalk (Seaside
web server), but they can be very useful in e.g. cases like yours for making
a convenient way to make a local exit. I did this in one toy game program
Hi,
I've got an IO action, some file system IO, traversing one level only and
iterating over files found. I wish to build in an "early" exit, ie. if an
IO action in the loop encounters a particular value I want it to abort the
loop.
Now so far, pls don't shoot, I have done this by throwi
Hello all,
This post is not about my own creation, it's just a little fun program
written by a student of mine. You can install the bloxorz package to try
it out, and read more about its background on my blog:
http://just-bottom.blogspot.com/2009/07/playing-and-learning.html
Gergely
--
http://
2009/7/3 Ross Mellgren
> Wordy (and yet technically accurate) names aside, isn't this basically the
> same thing, except that you must pass the dictionary around by hand?
>
A SomeWidget is defined as "any object which has a Widget dictionary". It's
still an object; the link from it to its dicti
We've had the Common Gateway Interface..
and the Web Server Gateway Interface..
now I think it's high time for the Haskell And General Gateway Interface for
Servers.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailm
2009/7/3 Jinjing Wang :
> Hack is such an inconvenient name for a package, may I get some
> inspiration from renaming it?
>
> Also, is there an idiom to use when upgrading package name on hackage?
>
> Best,
>
> --
> jinjing
Crack? Har har...
--
Deniz Dogan
___
I see some parallels between Inversion of Control/Dependency Injection
frameworks and monads. I would say annotations are tools that are
sometimes used for those frameworks, but they are also used for other
unrelated things (warning suppression, overriding functions ...) so it
may be more clear to
Hack is such an inconvenient name for a package, may I get some
inspiration from renaming it?
Also, is there an idiom to use when upgrading package name on hackage?
Best,
--
jinjing
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.has
Hi Edward,
Your runPretty version fits the bill nicely, thank you. I might still retain
the state monad version because it allows generalizations beyond
pretty-printing.
As for fixing the original bug, I've found that the real magic lies
in the incantation (Y . unY) inserted at the appropriate p
Wordy (and yet technically accurate) names aside, isn't this basically
the same thing, except that you must pass the dictionary around by hand?
What is the advantage of doing the dictionary passing manually, other
than being able to avoid the scoping issue (that requires case) and
the sligh
Wow, this complex Thank you. I will try that.
No, don't! There is an easier way.
(...) This is the point at
which you are forced to move away from OO thinking.
This seems to be worth clearing a little bit. I usually read
people saying that this kind of misundestanding is a confusion
w
Is there a way to hide instance definitions when importing a module for
instance
No, there isn't. See item 5.4:
http://haskell.org/onlinereport/modules.html
Best,
Maurício
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.or
Gwern Branwen wrote:
...
" Ultimately, the problem with Haskell and ML for our purposes is that
the brightest and most aggressive programmers in those languages,
using the most aggressive optimization techniques known to the
research community, remain unable to write systems codes that compete
re
Could you clarify on what is the precise relationship between the
annotations and monads? Or at least an example, like, "The @Foo
annotation corresponds to the Cont monad in the following way:..."
I personally don't see any connection at all, although I'm rather
familiar with both.
2009/7/3 Rafa
Hello,
After an extensive search (5 minutes googling) I could not find any comparison
between Java annotations (or Python annotations for that matter) and Monads. I
think they are similar in various aspects and I want to discuss them here.
I'm sure several of you have experience with Java program
It's important to note that such a function is not "Typeless" but rather
"Polymorphic" -- that is, it is a type which can be satisfied for many
values of it's type variables.
For instance, the function `(+) :: Num a => a -> a -> a` is polymorphic,
since it's one type variable can be satisfied
On 3 jul 2009, at 11:28, Jochem Berndsen wrote:
Chris Eidhof wrote:
I've something working that sort of does this. You define your
model in
the following way:
data User = User {name :: String, password :: String, age :: Int,
post
:: BelongsTo Post}
data Post = Post {title :: String, body
> From: Maciej Piechotka
>
> 1. Learning haskell I discovered that I/O should be avoided nearly 'at
> all costs'. The problem is that the IO monad is the only one which have
> more interactive work flow. There is Reader/Writer monad but in fact
> AFAIU first one is about the environment and second
Chris Eidhof wrote:
> I've something working that sort of does this. You define your model in
> the following way:
>
> data User = User {name :: String, password :: String, age :: Int, post
> :: BelongsTo Post}
> data Post = Post {title :: String, body :: String}
>
> Then there's some boilerplate
2009/7/3 Luke Palmer :
> Keep in mind that with this solution *and* with the
> ExistentialQuantification solution, there is no possibility of downcasting.
> I.e. if you were planning on making a GraphicalWidget subclass, and them
> somewhere seeing if a a Widget is actually a GraphicalWidget, you
Tillmann Rendel wrote:
> Now we can write our interpreter:
>
> eval :: Expression -> Result
> eval (Literal n)
> = Number n
>
> eval (Add a b)
> = case eval a of
> Number result_of_a
> -> case b of
>Number result_of_b
> -> Number (r
Is there a way to hide instance definitions when importing a module for
instance
I want to import Data.Monoid but wish to redefine the instance of Monoid for
( a->b)
I don't suppose this is possible?
Specifically, I wish to define a specialised instance of Monoid for
String->Int, but it see
On Fri, Jul 3, 2009 at 4:43 AM, Alexander
Dunlap wrote:
> swap :: Array (Int, Int) a -> [Int] -> Array (Int, Int) a
>
> The lowercase "a" means that that type variable is polymorphic, i.e.
> it can be any type.
Another option would be to simply not put in type of 'swap', load it
in ghci and see wh
Hello Magicloud,
> I thought "class" was for this purpose. But it turns out not.
http://haskell.org/haskellwiki/OOP_vs_type_classes
--
Best regards,
Bulatmailto:bulat.zigans...@gmail.com
___
Haskell-Cafe mailing list
H
On Thu, Jul 2, 2009 at 8:32 PM, Magicloud Magiclouds <
magicloud.magiclo...@gmail.com> wrote:
> Wow, this complex Thank you. I will try that.
No, don't! There is an easier way.
Don't use a class, just use a record.
I would translate your class as:
data Widget = Widget {
widgetRun ::
39 matches
Mail list logo