Thomas Hallgren wrote:
If classes were allowed to declare default
methods for superclasses...
Benjamin Franksen wrote (on Haskell Libraries):
Robert Will has written a fully specified proposal for this. He calls it
delayed method definition, see
http://www.stud.tu-ilmenau.de/~robertw/dessy/fun/,
I posted a link to the following on the HaskellTwo
wiki page. Please comment.
I would like to suggest that PatternGuards NOT be included
in HaskellTwo.
While I enjoyed Simon Peyton Jones' well-written
note on pattern guards
[http://research.microsoft.com/Users/simonpj/Haskell/guards.html]
very
impossible :: Empty - a
impossible _ = undefined
It's unfortunate that we can't define impossible without using bottom. I
dislike using bottom, and here we have a function that cannot return
bottom unless it is passed bottom. Such functions should be definable
without using bottom, but this
Using Debian testing with the ghc6-doc package
installed (version 6.4-3), I just noticed that I
only seem to have the Hierarchical Libraries
manual, but not the User's Guide nor the Cabal
docs (nor hslibs docs). Those links are broken on
the index.html page that was installed.
Did I do something
Isaac Jones wrote:
Yitzchak Gale writes:
Using Debian testing with the ghc6-doc package
installed (version 6.4-3)... (I was missing
docs)
It looks to me like this isn't the version from
testing fwiw, but the version from
unstable... try upgrading to the new version
(maybe Ian can say
Isaac Jones wrote:
Aaron Denney writes:
Isaac Jones wrote:
Michael Vanier writes:
Right now, the Debian unstable package for
GHC 6.4 won't install due to some conflict
with libgmp3...
...install the libgmp3 from stable... That
might work?
It should, but I have other packages
I heartily agree with everything Cale wrote
on this topic.
In addition, I hereby apologize to Claus for
being too lazy to participate in the survey.
Regards,
Yitz
Cale Gibbard wrote:
Despite having a fairly mathematical background, I don't really care
for the proposed syntax.
myList ::
John Meacham wrote:
f x y
| b c = ...
| c = 0 a b = ...
where
a = ...
b - ...
c - ...
f x y = ...
there is really no clean (IMHO) way to express this idiom otherwise,
What does this translate to (even if not clean)?
I am not sure I understand what
While checking for floating-point overflow and
underflow conditions, I tried to create a somewhat
reliable cross-platform Infinity with the literal
1e10.
When GHC 6.4.1 reads this literal, it goes into a
deep trance and consumes huge amounts of
memory. Shouldn't it immediately recognize such
I wrote:
While checking for floating-point overflow and
underflow conditions, I tried to create...
Infinity with the literal 1e10... Is
there a better way to check for Infinity?
Tomasz Zielonka wrote:
Did you try isNaN and isInfinite?
Oops. Thanks! Thanks also to Lennart
Hi Jacques,
Thanks also to you for a most interesting reply.
This same discussion has taken place on the
discussion list of every modern general-purpose
programming language.
The same points are always raised and argued, and
the conclusion is always the same: floating point
exceptions should
(Moved from the libraries list to the haskell
list.)
I wrote:
createItems :: RandomGen g = State g [Item]
createItems =
liftM catMaybes $ runListT $
flip evalStateT initialState $ runMaybeT $
do
item - liftRandom $ repeatM randomItem
updateState item
On 11/12/06, I wrote:
The following class declaration worked in GHC 6.4.
I recently upgraded to 6.6 (following Debian), and
now it is broken.
class Error e = Game b mv e | b - mv e where
newBoard :: MonadState b m = m ()
...
Hmm, following up on Simon Peyton-Jones' recent
announcement of
Wouter Swierstra wrote:
I am pleased to announce that a new issue of The Monad.Reader is now
available:
http://www.haskell.org/haskellwiki/The_Monad.Reader
Dougal Stanton wrote:
Thanks Wouter, the haiku look great! ;-)
I agree, they are fantastic! (And they are not short.)
Perhaps you
Tom Jordan wrote:
I tried Data.Map first and ran into the issue you mentioned...
Tom, could we please move this discussion to either
the Haskell Cafe or the Haskell Beginners mailing list?
(The choice basically depends on whether you mind if
the discussion might go off into deeper waters.)
This
1.2: it is essentially a slightly sugared variant of the lambda calculus
Should it be the simply-typed lambda calculus?
Also, there should be a reference; a significant percentage of those
reading this report will have never heard of the lambda calculus.
with a straightforward denotational
Steffen Schuldenzucker wrote:
Btw., does TH parse this correctly? (If I was TH, I would not):
myPHPCode = [s|
?php
$description = Use the quasiquoter like this: [s|some text|];
print $description.\n;
?
|]
(the tricky part is |] occurring in the quoted text)
Can we escape it?
Yes, like
Steffen Schuldenzucker wrote:
* Embed Haskell into some other language is solved by Literate Haskell
* Embed some other language into Haskell is solved by heredocs
Dave Bayer wrote:
Nice pairing. I wrote my own literate preprocessor, which GHC gracefully
accepts, to accomplish both of these
Ben Millwood wrote:
I once spent some time and energy making [foo| bar baz |\] quux |] do
the right thing for a quasiquoter I implemented, only to discover that
GHC already supports [foo| bar baz \|] quux |]. So yes, you can escape
it.
Wow, that actually works.
That is very surprising,
Gershom wrote:
...the HaskellWiki ...requires care and maintenance
and contributions from all of us.
I replied to this in the reddit thread at:
http://www.reddit.com/r/haskell/comments/339qxm/haskellcafe_help_wanted_with_wikihaskellorg/
Short summary:
1) Account Creation Management
I
Hi,
As requested, I am reporting the following bug that appeared
during a ghci session on a Debian testing box.
Regards,
Yitz
___ ___ _
/ _ \ /\ /\/ __(_)
/ /_\// /_/ / / | | GHC Interactive, version 6.0.1, for Haskell 98.
/ /_\\/ __ / /___| | http://www.haskell.org/ghc/
Manuel M T Chakravarty wrote:
I'd also be nice to have a cool logo/icon.
Don Stewart wrote:
Someone want to clean up the classic GHC logo?
http://www.cse.unsw.edu.au/~dons/images/happy-dino.jpg
:)
The Clyde Arc in Glasgow, combined somehow with a lambda,
could be the basis of a striking
Manuel M T Chakravarty wrote:
Finally, you can have the glorious GHC in a format satisfying the
discerning Mac user
Fantastic news! Thanks!
The GHC binary in the package links statically against GNU readline
(to provide editing capabilities at the GHCi prompt). This is fine as
GHC's BSD3
Manuel M T Chakravarty wrote:
Try this
http://www.cse.unsw.edu.au/~chak/haskell/GHC-6.9.20080213-i386.dmg
I got it, but there were some download problems. I hope the
file is intact. It has exactly 44740924 bytes. Perhaps you
could send me an md5sum to be certain.
Have a look whether that
Manuel M T Chakravarty wrote:
The file length is correct.
MD5 (Public/Web/haskell/GHC-6.9.20080213-i386.dmg) =
cc76dea615234aa83d85ef5c30021828
Bingo! Thanks.
I wrote:
In the readme, you say that I require Xcode 3.0. Tiger came with
Xcode 2.4.1, and I have not updated it. Could that be
Hi Neil,
Neil Mitchell wrote:
You can search for it in the standard libraries using Hoogle:
[something mangled]
I think you were trying to suggest searching for (a,b)-(b,a)
by using a URI directly. My mail reader justifiably
mangled your proposed URI, as would any non-broken
mail reader,
Claus Reinke wrote:
i tried at the time to get others to post their .ghci files at well,
and share their favourite tricks, but there weren't many responses.
OK, OK. I just posted Customized GHCi interactive environments
to wiki. It's a simple but very powerful trick that I use all the time.
Judah Jacobson wrote:
I'm writing a program that reads input from the user but should also
handle a ctrl-c...
It works fine compiled without -threaded, but with -threaded
it blocks forever after a ctrl-c.
Simon Marlow wrote:
Ah, this is a consequence of the change we made to
Moving this side point to the ghc users list...
Ashley Yakely wrote:
What is an orphan instance, and why do we care about them?
Simon Peyton-Jones wrote:
They are documented in the GHC manual
http://www.haskell.org/ghc/docs/latest/html/users_guide/separate-compilation.html#orphan-modules
The Debian ghc6 package for the stable distribution is currently
back at GHC 6.6 - not surprising given the way stable works at
Debian. There is currently no backport of a more recent GHC to
Debian stable.
I need GHC 6.8 for a project to run on a production server.
That means it will be running
Chris Kuklewicz wrote:
Who can suggest a way to cast from Float to Word32 and Double to Word64
using ghc? The actual task is that I need to write out the Float as a
little endian sequence of four bytes and also be able to read it back in.
The writing and reading are done in Put and Get
The (Interactive) Glasgow Haskell Compiler -- version 6.10.4
How to get it
http://www.haskell.org/ghc/
I have a few comments about the Distribution Packages page
that is linked from there:
http://www.haskell.org/ghc/distribution_packages.html
Debian:
Remove the line Newer packages
Hi Slavomir,
Slavomir Kaslev wrote:
inter x [] = [[x]]
inter x yys@(y:ys) = [x:yys] ++ map (y:) (inter x ys)
perm [] = [[]]
perm (x:xs) = concatMap (inter x) (perm xs)
I was surprised to find that not only my version is much simpler from the one
in Data.List but it also performs better.
Please add to the documentation for :set prompt:
If you enclose \i{prompt} in quotes, you can use Haskell
syntax for String literals.
Actually, :set prompt is nearly useless without quotes, because
GHCi strips off trailing spaces from commands. We should either
add a space at the end of a prompt
This discussion definitely does not belong on the
Haskell-Beginners list. Besides not being a topic
for beginners, being there is keeping it under the
radar of many or most of the people who work on
these things in Haskell.
I am moving the discussion to the GHC users list,
as suggested by
Daniel Fischer wrote:
(Note: Surprisingly (?), if you load a module with
{-# LANGUAGE NoMonomorphismRestriction #-}
, the monomorphsm restriction is still enabled at the ghci prompt, so we
have to disable it for that again - or we could have loaded the module with
$ ghci
Isaac Dupree:
We could try to find out how large Integers get, in practice, in
existing Haskell code (this may be difficult to find out).
Daniel Fischer wrote:
Just as a data-point, my code rarely exceeds 128 bits (at least, beyond
that performance isn't so important anymore).
And Daniel,
I wrote:
As another data point, Python has also re-invented the GMP
wheel, likely for the same licensing reasons. They have
been using a simple implementation of Karatsuba
multiplication for years. I have never heard of anyone
complaining about it
Greg Fitzgerald wrote:
Looks like they
I wrote:
I was suggesting that whenever the Prelude fails to load,
the error message should contain that hint.
hmm, I'll think about that. Is it not enough to see a compilation error
pointing to the file Prelude.hs?
Seems obvious in the context of this thread. But not being in
the middle of
My opinion is that we should either use TWO DOT LEADER,
or just leave it as it is now, two FULL STOP characters.
Two dots indicating a range is not the same symbol
as a three dot ellipsis.
Traditional non-Unicode Haskell will continue to be
around for a long time to come. It would be very
I wrote:
My opinion is that we should either use TWO DOT LEADER,
or just leave it as it is now, two FULL STOP characters.
Simon Marlow wrote:
Just to be clear, you're suggesting *removing* the Unicode alternative for
'..' from GHC's UnicodeSyntax extension?
Yes, sorry. Either use TWO DOT
On Fri, Apr 23, 2010 at 1:24 PM, Bayley, Alistair wrote:
Looks like the London HUG domain (londonhug.net) registration has
expired. Neil Bartlett was the registrant.
Neil: do you plan to renew?
The whois database reports:
Domain name: LONDONHUG.NET
This domain name is up for auction for a
leledumbo wrote:
I notice that many of the installed libs aren't required for learning
Haskell. What libs are required so I can get the bare minimum version of
GHC?
For most people, the recommended approach is to install
the Haskell Platform. This is not a minimal setup - it includes
packages
Henning Thielemann wrote on Haskell Cafe:
Attached is a program with a space leak...
I have coded a simple 'map' function, once using unsafePerformIO and
once without. UnsafePerformIO has a space leak in some circumstances.
In the main program I demonstrate cases with and without space leak.
Just after upgrading some basic packages from
Hackage, doesDirectoryExist began always returning
False. I suspect that this is related to the unix
package, and/or its strange interaction with the
directory package. See:
http://hackage.haskell.org/trac/ghc/ticket/4812
Thanks,
Yitz
Iavor Diatchki wrote:
I use git for a lot of my development...
Given the responses though, it sounds like this is a well
known problem with darcs with no obvious solution.
Why do you say there is no obvious solution? In fact, Ganesh,
representing the Darcs team, responded:
1) a darcs rebase
Simon Peyton-Jones wrote:
Generic Defaults... will replace... the Derivable type classes
stuff... in GHC 7.2 or 7.4...
Please yell if you are a secret user of derivable type classes,
so this change would discombobulate you.
Could you give us a preview of the parts of the syntax
spectrum that
Don Stewart wrote:
The haskell.org committee... has decided to
incorporate haskell.org as a legal entity. This email outlines our
recommendation, and seeks input from the community on this decision.
Thanks, good news! And thanks for posting to multiple
lists for maximum public notification to
It was pointed out by Ben Millwood on the Cafe
that there is an undocumented way to escape the
closing oxford bracket of a quasi-quote using
a backslash:
[s|This quasi-quote contains this, \|], an escaped
closing oxford bracket.|]
The backslash itself cannot be escaped in this
way:
[s|Also
On 12 November 2006 I wrote (on the haskell list):
class Error e = Game b mv e | b - mv e where
newBoard :: MonadState b m = m ()
...
Since MonadState has the fundep m - b, the type
of newBoard fully specifies all of the class parameters
But GHC 6.6 complains...
Simon Peyton-Jones
Simon Peyton-Jones wrote:
I just applied this rule
http://www.haskell.org/ghc/docs/latest/html/users_guide/type-extensions.html#id3170412
In this case the type of newBoard is
newBoard :: (Game b mv e, MonadStaet b m) = m ()
Following the rules in that manual section, this type
I have observed the following weird behavior:
When I define an instance of a certain MPTC
in a separate module from the definition of
the class, ghci's ability to recognize the
methods of the class seems to vary depending
on whether or not hi files exist for the modules.
I am using the current
I wrote:
I have observed the following weird behavior:
...ghci's ability to recognize the
methods of the class seems to vary depending
on whether or not hi files exist for the modules.
Daniel Fischer wrote:
Pertinent to this is section 3.4.3 of the user's guide, What's really in
scope at the
Duncan Coutts wrote:
iswspace... We could short-cut that for ascii characters.
Also, '\t', '\n', '\r', '\f', and '\v' are contiguous. So
isSpace c =c == ' '
|| c = '\r' c = '\t'
|| c == '\xa0'
|| c '\xff' iswspace (fromIntegral (ord c)) /= 0
That makes
Hi Christian,
binary distributions of GHC 6.8.1 for Mac OS X 10.4 (Tiger)
Great, thanks!
Can this be posted together with the other binary distributions at:
http://haskell.org/ghc/download_ghc_681.html
and also Manuel Chakravarty's Leopard build?
Warning: this binary distribution does NOT
Greg Fitzgerald wrote:
Running 6.8.1 on Windows XP, typing 'main' while :r is still processing
causes the 'm' in 'main' to morph to a 'g'.
Olivier Boudry wrote:
it (also works with :l).
Stefan O'Rear wrote:
It's very old. http://hackage.haskell.org/trac/ghc/ticket/831
But these
Quoth InteractiveUI.runGHCi:
case maybe_expr of
Nothing -
do
#if defined(mingw32_HOST_OS)
-- The win32 Console API mutates the first character of
-- type-ahead when reading from it in a non-buffered manner. Work
-- around this by flushing
Sigbjorn wrote:
This was a hack to work around similar behaviour when starting up GHCi,
Notice that my workaround is only applied upon startup, not in the REPL. =
floating the hackery inward could just save the day.
OK.
Simon Marlow wrote:
The underlying bug is in the Windows CRT, or
Simon Peyton-Jones wrote:
Given instance C T where ..., for any method 'm' not
defined by ...:
for every class D of which C is a superclass
where there is an instance for (D T)
see if the instance gives a binding for 'm'
If this search finds exactly one
Juanma Barranquero wrote:
In fact, it'd be better if GHC/GHCi would do what Emacs on Windows
does: use HOME if defined, else use ShGetFolderPath to find the
Windows-defined home directory.
I agree, that is closer to the correct behavior.
Except that on Vista ShGetFolderPath is deprecated.
Use
Removing support for %HOME% has suddenly broken many
programs. If people don't like it, we can consider
deprecating it in some future version of GHC, but for now
it should put back. I would say it is quite ironic that some
people are arguing against this by saying that it will lead
to more bug
Hi Seth.
Sorry, my asterisks were not at all meant to be a flame.
Please accept my sincere apologies if it appeared that way.
I wrote:
It is *not* trivial to wrap the function in question, and
it is not more correct.
Seth Kurtzberg wrote:
Why is it *not* trivial to wrap the function?
Hi Felix,
You have described your own style of using
some of the Window's Known Folders. In my
opinion your style is a bit Unixy, but that's fine,
you should be allowed to do it that way in GHC.
But GHC should not force others to do it only that way.
btw, years ago I used to use the Profile
I wrote:
Removing support for %HOME% has suddenly broken many
programs. If people don't like it, we can consider
deprecating it in some future version of GHC, but for now
it should put back.
Simon Marlow wrote:
Only GHCi has changed here. Perhaps you're under the impression that we
Thorkil Naur wrote:
Readline is free software, distributed under the terms of the GNU General
Public License, version 2.
Bulat Ziganshin wrote:
in short, that means that software compiled with this compiler AND
distributed to general audience, should have GPL-compatible license
(i.e. GPL or
Bulat Ziganshin wrote:
in short, that means that software compiled with this compiler AND
distributed to general audience, should have GPL-compatible license
(i.e. GPL or BSD-like)
(as far as i understand GPL/LGPL terms)
Any software compiled with this compiler, or only
software that uses
Christian Maeder wrote:
The extended packages 2 could go under extra libs or hackageDB, while
1 remains a boot package for ghc that can link to editline on macs
and readline under linux, but has the same interface and package name!
I would hope that ghc will link to editline-ext on all
Bulat Ziganshin wrote:
for me, GMP is much more problematic issue. strictly speaking, we
can't say that GHC is BSD-licensed because it includes LGPL-licensed
code (and that much worse, it includes this code in run-time libs)
Manuel M T Chakravarty wrote:
..binary distributions of GHC that
Isaac Dupree wrote:
GHC is in no legal trouble whatsoever... only if proprietary Haskell
code uses the readline library and doesn't switch to using the editline
backend.
Agreed. I didn't mean that GHC itself was ever in any
legal trouble. But as a compiler, it must be possible for
users to
Don Stewart wrote:
However, its buried in the rts/distributed with the runtime, so that
users may optionally use that version, rather than finding and
installing their own external gmp package. On almost all platforms
though, the distributed-with-ghc gmp is unused.
But doesn't that mean that
Don Stewart wrote:
on any system where an external libgmp is available, it will
be dynamically linked into the generated haskell programs,
and in-tree gmp isn't used at all (or compiled, or installed)
So on linux and *bsd, that should be fine.
On Mac OS X (as a special case of *bsd), we have
Christian Maeder wrote:
ghc will link to libedit if it is available on your platform, but the
Haskell package will still have the name readline and give ghc all the
functionality it needs (without licence problems).
Only the current readline Haskell package needs libreadline and
supplies more
Isaac Dupree wrote:
It's also possible to just distribute, for
example, the .o file(s) and a way to link them with a GMP to get the
final result; this doesn't even reveal your source-code any more than
your program being dynamically linked, at least if you do it right -- right?
It doesn't
Hi Christian,
Christian Maeder wrote:
...Even better if the current package readline is renamed to old-readline
and readline-compat to readline.
I have been trying to understand why you want to do
that. What would we gain?
Thanks,
Yitz
___
Christian Maeder wrote:
Where are the users that use the functionality not supported by
editline's emulation layer? (Shout now or be quiet ever after)
I only wanted to find out which user group would need to change readline
to editline and (if following my suggestion) which group readline to
Christian Maeder wrote:
3. if ghci is going to use editline... then readline would not
need to be a core package und users might need to
install package readline explicitly.
OK, I get it.
Even if we leave readline as it is, so that the package system will
theoretically not force the person to
Denis Bueno wrote:
the Read StdGen instance should never fail. However, in GHC 6.8.2, it
appears to:
It first fails for me on strings of length seven.
You need to use fst . head . reads instead of read.
The Read instance of StdGen only uses part of the string,
and politely gives you back the
George Giorgidze wrote:
My second proposal is to introduce the
OverloadedLists extension that overloads
list literals...
I am opposed to this proposal as stated.
But I think that with a modification,
it can not only be improved, but also solve
the problems with the current OverloadedStrings
Roman Leshchinskiy wrote:
In general, if we are going to overload list literals then forcing the
desugaring to always go through lists seems wrong to me. There are plenty
of data structures where that might result in a significant performance
hit.
These are literals. So the lists will almost
Simon Marlow wrote:
It would probably be better to have an abstract FilePath type and to keep
the original bytes, decoding on demand. But that is a big change to the API
and would break much more code. One day we'll do this properly; for now we
have this, which I think is a pretty reasonble
Simon Peyton-Jones wrote:
Trouble is, what type does this have?
f x = x {}
Malcolm Wallace wrote:
Empty record patterns {} are permitted, even for types
that are not declared with named fields.
So I don't see why an empty record update should
require the type to be declared with named
Simon Peyton-Jones wrote:
Trouble is, what type does this have?
f x = x {}
Malcolm Wallace wrote:
f :: a - a
Ian Lynagh wrote:
That wouldn't help the original poster, as it is incompatible with
f :: Foo Clean - Foo Dirty
Only because in that expression the type of x is not known.
I wrote:
Yes. The translation of record updates given in the Report
makes perfect sense for {}. It is only forbidden by
n = 1, but no reason is given for that restriction.
d wagner wrote:
It doesn't make sense to me. The translation explodes a value into a case
statement over its
Gershom Bazerman wrote:
Beyond that, it would really help namespacing in general to appropriately
extend the module system to allow multiple modules to be declared within a
single file -- or, better yet, submodules. I know that this introduces a
few corner cases that need to be thought through
Serge D. Mechveliani wrote:
I have ghc-7.4.0.20111219 made from source and tested it on the
DoCon-2.12 application -- thanks to people for their help!
It looks all right.
This was -- with skipping the module Random
Now it remains to add the Random package.
I have taken AC-Random Version
I wrote:
Today, it is very unusual to use GHC by itself.
To use Haskell, you install the Haskell Platform.
That is GHC together with Cabal and a basic
set of libraries. It is very easy to install.
Wolfram Kahl wrote:
However, since you are willing and able to test bleeding-edge versions of
By the way, thanks to Greg for driving this discussion,
please keep up the good work!
Simon Peyton-Jones wrote:
Can you turn your proposal into a Wiki page?
OK I'll try to get to that later today.
It's different to Johan's.
Oh? I didn't realize that. OK, I'll look at it more closely.
I'm
Evan Laforge wrote:
Is there something that changed in 7.4.1 that would cause it to decide
to interpret .hs files instead of loading their .o files? E.g.:
Brandon Allbery wrote:
I thought this was deliberate because the debugger won't work with object
files?
Oh I hope not. I almost never
Jeremy Shaw wrote:
I have often wished for something like:
{-# LANGUAGE StringLiteralsAs Text #-}
where all string literals like:
f = foo
would be translated to:
f = (fromString foo :: Text)
Agreed, I would also really like this.
I find that OverloadedStrings is too general
I wrote:
In addition, OverloadedStrings is unsound.
J. Garrett Morris wrote:
fromString can throw errors, just like fromInteger
This is true; the use of polymorphism
for numeric literals is also unsound.
However, in practice, it is rare for there to be
dangerous instances of the numeric type
Greg Weber wrote:
I very much agree with you. However, when we complain about something
essentially we are asking others to prioritize it ahead of other
things. I don't think any more visibility of this issue is going to
improve its prioritization. I suspect your only way forward right now
is
J. Garrett Morris wrote:
By this logic, head is unsound, since head [] throws an error.
Haskell types are pointed; Haskell computations can diverge.
Well, there are those who would actually agree with
that and banish 'head' and friends from the language.
But I'll agree with you here.
[As an
Michael Snoyman wrote:
Here's a theoretically simple solution to the problem. How about
adding a new method to the IsString typeclass:
isValidString :: String - Bool
...whenever GHC applies OverloadedStrings in a case
where the type is fully known at compile time (likely the most common
Markus Läll wrote:
What can go wrong when you use an overloaded string to be fromString'd
into Text?
Here's an example:
The author of the xml-types package provides an IsString
instance for XML names, so you can conveniently
represent XML names as string literals in your source
code.
But not
Simon Peyton-Jones wrote:
If you want validation of literal strings, then TH quasiquotes are the way to
go:
I agree. OverloadedStrings is, in effect, an unsafe replacement
for quasiquotes. People find OverloadedStrings easier to use
than quasiquotes, so its use in that way is becoming popular.
Markus Läll wrote:
You do know, that you already *can* have safe Text and ByteString from
an overloaded string literal.
Yes, the IsString instances for Text and ByteString are safe
(I hope).
But in order to use them, I have to turn on OverloadedStrings.
That could cause other string literals
Daniel Peebles wrote:
Why are potentially partial literals scarier than the fact that every value
in the language could lead to an exception when forced?
That's a legitimate question, but it's strange to hear it from
you.
People ask that same question about Haskell's static
type system. Why
Simon Marlow wrote:
In this thread people are using the term safe to
mean total. We already overload safe too much, might it be a better
idea to use total instead?
I'm not sure what you're talking about. I don't see how
this thread has anything to do with total vs. partial
functions.
I'm
Hi Simon,
First of all, I'm sorry if I'm coming off as too combative,
as Greg says. That is certainly not my intention.
I'm not asking for any free work from you, either.
The only reason I don't like using OverloadedStrings
for typing string literals as Text and ByteString
is that when you turn
Erik Hesselink wrote:
I don't think IsString should be dismissed so easily.
I'm just saying I don't want to be forced to use it.
If others like it, I'm not dismissing it.
we have a couple of newtypes over Text that do different kinds of
normalization. An IsString instance for these is useful
1 - 100 of 629 matches
Mail list logo