tis 2003-12-02 klockan 14.23 skrev Johannes Waldmann:
> Martin Norbäck wrote:
>
> > main = do input <- readline "prompt> " ; handle input
>
> but this only reads one line (and it gives a Maybe String)
> I wanted a (lazy) list of all input lines,
> w
tis 2003-12-02 klockan 12.55 skrev Johannes Waldmann:
> I am looking for an example program
> that uses System.Console.Readline
>
> http://www.haskell.org/ghc/docs/latest/html/readline/System.Console.Readline.html
>
> If my main program looks like this:
> main = do input <- getContents ; handle i
u make
any changes to it?
Regards,
Martin
--
Martin Norbäck [EMAIL PROTECTED]
Kapplandsgatan 40 +46 (0)708 26 33 60
S-414 78 GÖTEBORG http://www.dtek.chalmers.se/~d95mback/
SWEDEN
CPS to represent an infinite data type.
Yes, you can simulate lazy evaluation. But the point is that we don't
want to simulate it, we want it built-in into the language, for
optimization purposes.
Regards,
Martin
--
Martin Norbäck [EMAIL PROTECTED]
Kappland
tor 2002-10-17 klockan 17.32 skrev Simon Marlow:
> Note that Happy has support for some Haskellish things which you won't
> get if you use bison to generate Haskell. For example: type signatures
> on productions, and support for threading a monad around the parser.
Another feature which I would l
t
> this optimisation? Thank you for your feedback.
The easiest way is to make it a function
l _ = [ i*i*i | i <- [0..n] ] -- for very large n
x1 = f1 (l ())
x2 = f2 x1 (l ())
x3 = f3 x2 (l ())
() can be any value really.
Regards,
Martin
--
Martin Norbäck
.map"?
I think it's just because it's easier to read/write
concatMap f list
than
(concat.map) f list
Regards,
Martin
--
Martin Norbäck [EMAIL PROTECTED]
Kapplandsgatan 40 +46 (0)708 26 33 60
S-414 78 GÖTEBORG
tis 2002-09-10 klockan 01.22 skrev Manuel M T Chakravarty:
> Martin Norbäck <[EMAIL PROTECTED]> wrote,
>
> > I have a question about the Main.main naming convention. Would it be a
> > good idea to lift the restriction and allow any module which exports a
> > functio
top level.
Regards,
Martin
--
Martin Norbäck Safelogic AB
[EMAIL PROTECTED]Stena Center 1C
+46 (0)31 772 81 70S-412 92 GÖTEBORG
http://www.safelogic.seSWEDEN
signature.asc
Description: PGP signature
top level.
Regards,
Martin
--
Martin Norbäck [EMAIL PROTECTED]
Kapplandsgatan 40 +46 (0)708 26 33 60
S-414 78 GÖTEBORG http://www.dtek.chalmers.se/~d95mback/
SWEDEN OpenPGP ID: 3FA8580B
signature.asc
Description: PGP signature
e moderated? This will make things progress more
slowly.
Regards,
Martin
--
Martin Norbäck [EMAIL PROTECTED]
Kapplandsgatan 40 +46 (0)708 26 33 60
S-414 78 GÖTEBORG http://www.dtek.chalmers.se/~d95mback/
SWEDEN Ope
o.
Looking at my original post (UTF-8 library), I never expected this much
traffic :)
Can't we make a mailing list for these issues?
[EMAIL PROTECTED] is my proposal, who can create such a list?
I'm interested in participating in a working group to solve these
issues.
Regards,
tor 2002-06-20 klockan 18.54 skrev Jens Petersen:
> Malcolm Wallace <[EMAIL PROTECTED]> writes:
>
> > We are pleased to announce a new release of Hat, the Haskell tracing
> > (an debugging) system for Haskell'98.
>
> > For information on hat: http://www.cs.york.ac.uk/fp/hat/
> > For hat do
t it works for any numeric type, including Int)
instance Num a => A a where
inc a = a + 1
Regards,
Martin
--
Martin Norbäck [EMAIL PROTECTED]
Kapplandsgatan 40 +46 (0)708 26 33 60
S-414 78 GÖTEBORG http://www.dtek.chalmers.se
bility to translate an application without having
to recompile it and good tool support.
> i18n is a useful hack to retrofit onto the C printf system, but I think it
> would be a backward step for Haskell.
Since I've never seen any i18n systems for Haskell, everything w
tis 2002-05-14 klockan 18.56 skrev anatoli:
> Robert Ennals <[EMAIL PROTECTED]> wrote:
> > Surely that problem only arises if one insists on encoding all the relevant
> > information inside a string.
>
> This is pretty much the only option, because translators
> and programmers are different peo
tis 2002-05-14 klockan 16.45 skrev Robert Ennals:
> > Martin Norbäck <[EMAIL PROTECTED]> wrote:
> > > I agree that i18n needs positional arguments.
> > > What's wrong with simply doing like this:
> > >
> > > printf "I have %. %. %..&q
ll rest' || head rest' /= '.' || index > length xs then
'%':printf (d:ds:rest') xs
else
xs!!(index - 1) ++ printf (tail rest') xs
printf (r:rest) xs = r:printf rest xs
printf [] _ = []
Note that there are no errors if the format st
for that MIME type will not see it as text in the
browser.
So using text/ is a good way of specifying that the fallback of just
showing the contents as text is perfectly OK.
Even better maybe would be to have source/haskell, but introducing a
completely new top-level media type is a bit heavy.
plain text is OK.
x-* means that it's not an officially registered MIME type (there is
really no need to register it officially.)
Our hope is that everyone will use these MIME types where appropriate.
Regards,
Martin
--
Martin Norbäck [EMAIL PROTECTED]
Kapplandsgat
ot of work yourself here, and only got stuck on
the strange >.> operator.
One of the things about this book which I don't like is that Thompson
introduces a lot of non-standard functions.
You can try to make the following definition in your file:
(>.>) = flip (.)
Regards,
tor 2002-03-14 klockan 08.02 skrev Ketil Z. Malde:
> "Manuel M. T. Chakravarty" <[EMAIL PROTECTED]> writes:
>
> > The detailed choice of colours is, of course, adjustable.
> > At least on a Unix machine, I am quite sure you can use
> > XEmacs also in batch mode to generate the HTML
>
> Sure. Ha
mån 2002-03-04 klockan 15.11 skrev Rijk J. C. van Haaften:
> Hello,
>
> Recently, I wrote a function similar to
>
> x :: a
> x = x 42
>
> which is type-correct (Hugs, Ghc, THIH).
> Still, from the expression it is clear
> that the type shoud have a function type.
It might interest you to know
lör 2002-02-02 klockan 16.03 skrev Antony Courtney:
> Of course, good compilers/tools will let you turn such warnings on and
> off selectively, and good programmers write programs that compile
> without warnings (since warnings usually indicate dubious constructs).
> While the examples you give
fre 2002-01-25 klockan 08.27 skrev David Feuer:
> Martin Said:
>
> > Those two constructs are not the same
>
> > Compare
>
> > newtype T1 = C1 Bool
> > dataT2 = C2 !Bool
> The report says clearly that for a newtype like T1,
> C1 _|_ = _|_
> This is the same as for T2 and C2.
No.
C1 _|_
fre 2002-01-25 klockan 02.21 skrev Feuer:
> Please reply to [EMAIL PROTECTED]
>
>
> I don't remember if I answered this before, but...
>
> I don't see the relevance of there being no constructor to match on. That
> is the case for any tuple type. It seems that
>
> newtype T1 [a1 a2 ...] = C1
tis 2002-01-22 klockan 15.52 skrev Feuer:
> Why is pattern matching on newtypes lazy? Does this add to efficiency
> somehow? If not, it seems to be just another rule to keep straight.
That's the difference between newtype and data. Newtypes are unboxed, so
there is no constructor to match on. P
Wed Dec 29 1999, [EMAIL PROTECTED] ->
> Is it possible to define an inverse function such that given the functions
> f,g, and h and their inverses f',g', and h', the inverse function would
> return the appropriate inverse?
> e.g.
> inverse(f)=f'
> inverse(g)=g'
> inverse(h)=h'
Do you want to have
Mon Dec 06 1999, Keith Wansbrough ->
> Sergey:
> > I propose for Haskell-2 to add to the library
> >
> > delBy :: (a -> Bool) -> [a] -> [a]
> > delBy _ [] = []
> > delBy p (a:as) = if p a then as else a:(delBy p as)
>
> So what do you propose as the definition for
>
> del :: (
Fri Nov 19 1999, Greg O'Keefe ->
> The Haskell 98 Report contains the following example, in section 7.2 on
> page 89:
>
> main =readFile "input-file" >>= \ s ->
> writeFile "output-file" (filter isAscii s) >>
> putStr "Filtering succesful\n"
>
-BEGIN PGP SIGNED MESSAGE-
On Thu, 28 May 1998, S. Alexander Jacobson wrote:
> If you have a statement like:
>
> result= a || b || c
>
> does Haskell guarantee that a gets evaluated before b?
> If it does then I only have to protect against pattern match failure in
> one place, a.
Ye
On Wed, 25 Feb 1998, Jerzy Karczmarczuk wrote:
: PS. Could somebody inform me what is the current status of
: multi-parametric classes? Concretely (for example) I would
: like to construct a generic Universal Parser
:
: type Uparser a c = [c] -> [(a,[c])]
:
: which consumes any stream and prod
Hi!
When I was trying to sleep last night I though I could implement Search Trees
in Haskell.
And not only that, I would try to implement them as monads.
The problem is that search trees require context Ord a.
What I want is something like the following:
- - - - - - - - - - - - - - - - - - - -
33 matches
Mail list logo