Currently -fallow-overlapping-instances only allows overlapping instances
if one is a strict subset of the other. This is good (determinate), but
sometimes you really need two instances that partially overlap. It would
be nice if this could be disambiguated simply with another instance
Currently -fallow-overlapping-instances only allows overlapping instances
if one is a strict subset of the other. This is good (determinate), but
sometimes you really need two instances that partially overlap.
From a type-theoretic viewpoint,
instance declarations are relations between
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Thu, 16 May 2002, Simon Peyton-Jones wrote:
GHC doesn't remove intermediate lists down both
branches of a zip, so yes, you'll get intermediate lists.
Does deforestation not apply in this situation?
- --
Russell O'Connor
I have a curious Haskell design pattern. It's called one class per
function. It's strange, but I find that as I need more and more
generality, I end up with classes that look like this:
class (Monad m) = MonadGettableReference m r where
{
get :: forall a. r a - m a;
Bjorn Lisper:
...sometimes the length of a list being returned from a
function can be a simple function of the function arguments (or the sizes of
the arguments), think of map for instance. In such cases, a static program
analysis can sometimes find the length function. If we know thee
On Friday 17 May 2002 02:10, John Peterson wrote:
We could go to member-only
posting if that's what people want but it means that students asking
their homework questions will have a harder time :-).
Surely that's a good thing! Maybe they will go to the people who are paid to
help them, or
Jerzy:
Me:
...sometimes the length of a list being returned from a
function can be a simple function of the function arguments (or the sizes of
the arguments), think of map for instance. In such cases, a static program
analysis can sometimes find the length function. If we know thee functions
There are a number of people interested in FP at the University of
Leicester, so maybe we can increase that number ...
UNIVERSITY OF LEICESTER
DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE
The Department of Mathematics and
To find out how Haskell implementations treat negated
literals, I tested
the following program:
main = print (minusTwo,trueOrFalse)
minusTwo = -2::N
trueOrFalse =
case minusTwo of
-2 - True
_ - False
data N =
Dear Dr. Haskell,
I have been appointed to serve as the General Chair of the Summer 2002
edition of the SSGRR series of international conferences.
The SSGRR-2002S (Summer) conference on
Infrastructure for e-Business, e-Education, e-Science, and e-Medicine
takes place in SSGRR (Scuola Superiore
Robin,
Thanks very much for this. My problem turned out to be tripping over the
monomorphism restriction. When I looked at this it looked like a candidate
for dependent types but as you point out you can solve this just as well in
Haskell 98. You save a set of brackets with my approach!
On Thursday 16 May 2002 11:48 pm, Ashley Yakeley wrote:
I have a curious Haskell design pattern. It's called one class per
function.
[...]
I'm not sure if this is a good thing or a bad thing or what.
You might want to take a look at the class system for the language Concurrent
Clean. It
Hi.
Im a new haskell user, I know there are library about graphs, but i need to know all
the info about, where I can download this library, and what can i do with it, and how
can I use it.
Thanks.
__
Your favorite stores,
Sebastien Carlier [EMAIL PROTECTED] writes:
Specifically, I'd like to use pipe from the Posix
library to create a pipe and then pass one end of it to
runProcess as its stdin.
You may want to take a look at POpen (available from hslibs
cvs, or
ÄúºÃ£¬ÎÒÊDZ±¾©ÍòÀÊÍøÂç¿Æ¼¼ÓÐÏÞ¹«Ë¾Êг¡¿ª·¢²¿£¨Mario
Hi,
I have had problems with pipes and runProcess, now I am using
forkProcess/executeFile/getProcessStatus and it works properly.
Non-lazy IO presumably? Do you have an example you can show?
Sure:
---_%--- cut here ---_%---
module Main where
import IO
import Posix
import System
main =
Sebastien Carlier [EMAIL PROTECTED] writes:
I have had problems with pipes and runProcess, now I am using
forkProcess/executeFile/getProcessStatus and it works properly.
Non-lazy IO presumably? Do you have an example you can show?
Sure:
---_%--- cut here ---_%---
snip
---_%---
I meant do you have an example of your working code.
Sure.
SubProcess.lhs
Description: Binary data
localhost% cat Main.hs
module Main where
import SubProcess
main =
do cs - subprocess /bin/cat [] (Just $ replicate 1 $ 'a')
putStrLn $ show $ length cs
localhost%
* Sebastien Carlier [EMAIL PROTECTED] [020517 17:17]:
I meant do you have an example of your working code.
Sure.
I'm sorry if this is a bit off-topic, but I got the following error
when compiling Sebastien's code (with my ghc-5.02.3-2mdk):
SubProcess.lhs:5:
failed to load interface
On Friday, May 17, 2002, at 11:58 AM, Jerry, JiJie wrote:
SubProcess.lhs:5:
failed to load interface for `Posix':
Could not find interface file for `Posix'
while my Posix library files found in /usr/lib/ghc-5.02.3/imports/posix/
and also my /usr/lib/ghc-5.02.3/package.conf
Hi, I'm sorry to bother everyone again with this simple append' stuff
-- below is my revised append' function
1) append' :: [[a]] - a - [[a]]
2) append' [] y = [[y]]
3) append' (x:xs) y =
4) case xs of [] - foldr (:) [y] x
5)(z:zs) - (init (x:xs)) ++ [(last xs)++[y]]
-- to
On Fri, 17 May 2002, Jerry wrote:
Hi, I'm sorry to bother everyone again with this simple append' stuff
-- now this is something I _really_ don't understand:
-- x is of type [a], [y] is of type [a], and isn't foldr (:) [a] [a]
-- perfectly valid?!
:type foldr
forall a b. (a - b - b) - b -
Hello,
I am writing a function which returns an exception/error string should an
unexpected parameter is passed in. Borrowing from the Maybe module I have the
following:
data Result a = Ex String | Value a deriving Show
--
In short, you cannot.
What if your main were:
main = getArgs = print . first_h
The compiler doesn't know the difference and so it needs a type.
Simple fix:
main = print (first_h ([] :: [Char]))
--
Hal Daume III
Computer science is no more about computers| [EMAIL PROTECTED]
than
Erm, I think I said something stupid (or at least implied it).
main = getArgs = print . first_h
*will* work, because it knows that the result of a getArgs is a list of
Strings.
The problem you originally had was that when you say:
first_h []
The [] could refer to a list of any type of
The problem is that a is still ambiguous. For instance, look at the
difference between:
show ([] :: [Int])== []
show ([] :: [Char]) ==
because character lists are shown between quotes. so even though we know
that this type variable a is an instance of show, we still
26 matches
Mail list logo