Hi Jamie,
As a side note - I'd be very interested to see a Haskell implementation of
H264 decoding. I'm currently having to use the ffmpeg library in C, and
it's notoriously buggy with memory leaks left right and centre. A
haskell solution would be very much welcome!
Regards,
Chris.
On Wed, 11
Hi Silviu,
There's the GCJNI:
http://www.haskell.org/gcjni/
Which is basically a greencard-ed JNI interface for Haskell. I'm not sure
it's still suported but may be worth a shot.
Regards,
Chris.
On Mon, 9 Feb 2009, Silviu ANDRICA wrote:
Hello,
I was wondering if there is a way to call
Hi,
The only thing I can think of is GCJNI:
http://www.haskell.org/gcjni/
This makes use of the FFI and a Greencarded Java JNI interface. It does
allow you to call Java programs from Haskell. However, I'm not sure if it
is still supported.
hth,
Chris.
On Tue, 9 Sep 2008, [ISO-8859-1]
Or define your own ghead and gtail:
ghead msg [] = error ghead ++ msg ++ []
ghead _ (x:xs) = x
gtail msg [] = error gtail ++ msg ++ []
gtail msg (x:xs) = xs
and you can call them with a name of a function to give you an idea where
the error is occurring:
myHead = ghead myHead []
Chris.
Hi,
I may be wrong here, but I don't belive it's just let-patterns that have
this property. I.e. what's the difference between...
(Just x) = _|_
f = x
vs.
f = let (Just x) = _|_ in x
vs.
f = x where (Just x) = _|_
I believe Haskell uses Normal Order Reduction in all these cases. Why is
it
, Jonathan Cast wrote:
On Wed, 2008-08-27 at 20:14 +0100, C.M.Brown wrote:
Hi,
I may be wrong here, but I don't belive it's just let-patterns that have
this property. I.e. what's the difference between...
(Just x) = _|_
f = x
vs.
f = let (Just x) = _|_ in x
vs.
f
to resolve.
regards,
Chris.
On Sat, 23 Aug 2008, Brandon S. Allbery KF8NH wrote:
On 2008 Aug 23, at 17:29, C.M.Brown wrote:
I wonder whether seg faults are the true analogue to errors such as
error: head empty list. or pattern match errors.
Not really; while laziness does introduce a certain
I guess I didn't express my point very clearly... That C programmers
apparently don't realise that a type system that's sound will give
them something -- i.e. their programmer won't ever segfault. I wonder
when we try to advertise Haskell if we should be saying we can give
you programs that
Hi,
Sounds bad. Consider:
gray :: Color
grey = newColor #ccc
This fairly common style of bug now becomes perfectly valid Haskell,
and if you always refer to grey, you may never even have a clue that
the bug is present.
I think the compiler should certainly give a warning that no
Andrew,
[...]
For the record, I have no problem with modules depending on each other,
so long as they only depend on their well-defined interfaces.
Finally, as chris suggests, if separate compilation is important to
you, why not have a flag in ghc -frequire-hi-boot or something?
Well,
Andrew,
But isn't this exactly the point I was trying to make!? The whole point,
to me, in functional programming, is that we shouldn't have to worry about
the underlying implementation.
It is not exposing an underlying implementation detail to mandate that
modules should have
Andrew,
Thanks very much for your reponse. It was very helpful; this makes a lot
of sense!
Regards,
Chris.
On Mon, 11 Aug 2008 [EMAIL PROTECTED] wrote:
G'day all.
Quoting C.M.Brown [EMAIL PROTECTED]:
Yes, I saw that, thanks! I guess this is because it's hard to compile a
mutually
I'm not sure that it does make a lot of sense -- we allow (mutually)
recursive functions, even though they come with an efficiency
penalty. Why should we not allow (mutually) recursive modules, even
though they too come with an efficiency penalty. This is even an
example where the
The problem is not mutually recursive modules. Plenty of statically
typed languages support mutually recursive modules.
The problem is that it's impossible in general to say what the
interface of a module is by examining the module alone. This is a
very unusual property as real-world
Hi,
I have a question about cyclic inclusions. It appears in the Haskell 98
report that mutually recursive modules are allowed, however GHC complains
at any Haskell project that has cyclic inclusions (implicit or explicit).
Am I right in thinking that this is a GHC limitation?
Hi Don,
GHC provides a mechanism to support mutually recursive modules, but
you must break the cycle manually, via a boot file.
http://www.haskell.org/ghc/docs/latest/html/users_guide/separate-compilation.html#mutual-recursion
Yes, I saw that, thanks! I guess this is because it's
Hi Fernando,
I hope you don't mind, but I've moved this over to the Haskell-beginners
mailing list, where I think this kind of question will be more
appropriate.
In Haskell, it helps to think of functions in terms of an input and an
output, that is, what is the thing that is going into the
Hi Ivan,
Assuming I get it included, is there any features in particular you'd want to
see in there? Note that if I do have it produce visualisations, they'll be
static images as part of an analysis report rather than being interactive.
I'd basically like to see a graph of the overall
Hi Jno,
I suggest that you have a look at HaSlicer, a (visual) Haskell
slicing tool available online from http://labdotnet.di.uminho.pt/
HaSlicer/HaSlicer.aspx , developed by Nuno Rodrigues ([EMAIL PROTECTED]).
Oh excellent, yes I'd forgotten about this, thanks.
Chris.
Hi,
I have approx. 100+ source files and I was wondering if anyone has a tool
that would let me see a visual call graph for the source files; i.e. a
visual hierarchy of which module is imported by what, and so forth.
Kind regards,
Chris.
___
On Wed, 21 May 2008, HP Wei wrote:
Suppose p1, p2, p3 are 3 predicates
that take an input -- say, a String.
They return either (True, result)
or False.
I want to get an effect like in this expression:
case p1 s of
(True, r) - r
False - case p2 s of
On further thought, better to use the Maybe afterall. You can use Nothing
to signify your False and Just to signify your result.
case p1 s of
Just result - result
Nothing - case p2 s of ...
That's probably more intuitive to what you were intending.
Chris.
On Wed, 21 May 2008, C.M.Brown
Hello,
I want to use the ghc evaluator on the fly for some refactorings within
HaRe. However, I notice that runstmt ::Session - String - IO RunResult.
Is there anyway I can grab the result of the evaluated expression as a
String (rather than it being outputted to the terminal)?
It seems
Hi Simon,
Yes I do, please! Would you feel up to doing so? I'm sure Simon'd check
your text for veracity!
I have modified the wiki, and added a new section under initialisation:
http://www.haskell.org/haskellwiki/GHC/As_a_library
Would it also be appropriate to modify that wiki page to
Simon,
The GHC API is behaving just like --make: it links the program if you
have a Main module. To ask it not to link, you want to do the same as
'--make -c', which in the GHC API means setting the ghcLink field of
DynFlags to NoLink.
Thanks, this has solved the problem I was having. I
Hello,
I am trying to use the API to interpret a Main module and get some type
information from it. However, everytime I try to load a Main.hs module
using the API I get the following error message:
/usr/local/packages/ghc-6.8.2/lib/ghc-6.8.2/libHSrts.a(Main.o): In
function `real_main':
Hi Nikolas,
I supppose you're talking about HaRe, that Thomas Schilling linked to.
I have no idea how that system is built so I can't answer your
question. But in principle I don't see why not. :-)
In principle it would actually be quite difficult. HaRe is Haskell 98,
built upon the
I believe that the limitation is that they use Programatica's parser
to get an AST to run their refactorings on. I think they've looked
several times at using ghc's apis to do this, but hit various
problems. I think that the main problem is that no other parser
preserves things like code
Hi,
It seems that GHC's API interface has changed between 6.6 and 6.8. Most
notably, JustTypecheck and GHC.dropForAlls are no longer in scope.
Are the changes documented anywhere? The notes on the hackage commentary
still seem to point to the previous API internals.
Thanks for everyone's help with this so far. However, I'm having some
problems using cabal:
Whenever I try to
runghc Setup.hs install
a cabal file (I've tried parsec and network) I get an error message
similar to this:
Setup.hs: parsec.cabal:15: Unknown field 'build-type'
I tried to install
Looks like your version of cabal is a bit old. Try updating to the 1.2.3
or 1.3 series. You can find it on hackage.haskell.org
I'm using the runghc command from ghc-6.8.2, is that right?
[EMAIL PROTECTED] ~/filepath-1.0 $ which runghc
/usr/local/packages/ghc-6.8.2/bin/runghc
Cheers,
Chris
runghc finds ghc in the path, so it might be using a ghc from /usr/bin
or somesuch. Try compiling Setup with ghc 6.8.2 instead
(ghc --make Setup).
Excellent, that worked a treat! thanks.
Chris.
Thanks
Ian
___
Glasgow-haskell-users mailing
Hi,
I have just built and installed ghc-6.8.2 on my linux box but I can't find
the network package. Has it been moved or left out?
Kind regards,
Chris.
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
Hi Peter,
Is any work being done on Haskell refactoring support, like HaRe or others?
HaRe is still very active and is due for a new release very soon.
There are probably in excess of 40 refactorings for HaRe in total now, and
I intend to add more! Sadly, I am currently the only maintainer left
Cool! I'll check it out. However, I'm using some GHC extensions, so that
is
indeed a show stopper :)
Which extensions are you using that are not Haskell 98? I would be very
interested to know what users would generally require from a refactorer.
You mean a syntax-directed editor, right?
Hi Bulat,
i don't use
type signatures at all - this creates some problems when i wrote large
portion of code and try to make it compile, but nothing more
I believe type signatures are the very essence of Haskell documentation!
I'd much rather see a program with type signatures for functions
Currently, I'm trying to learn arrows and Yampa (mainly to see how well it
compares to my own dataflow/reactive stuff that was written in C#, C++ and
assembler)
Arrows won't work with HaRe at the moment, therefore Yampa won't either;
which is a shame.
First of all, let's see if I get the
Furthermore, IMHO, type signatures alone are not enough, a good parameter
name says at least as much as the type.
Yes! A very good point! :)
E.g. what does a function Int - Int - Bool do? I have no idea. A good
function name helps, e.g. isDivisible:: Int - Int - Bool. But then I still
Hi,
A possible first goal would be, to add extensions that are definitely in
Haskell prime, see:
http://hackage.haskell.org/trac/haskell-prime/wiki/Status'#definitely-inProposalStatus
Oh great! Thanks for the link, I think the main issue is moving over to a
platform that is heavily
On Fri, 4 Jan 2008, Bulat Ziganshin wrote:
Hello Peter,
Thursday, January 3, 2008, 11:03:58 PM, you wrote:
Okay, but when using a syntax directed editor, type signatures can be
automatically provided because the types are known.
the same is possible for Haskell - it's possible to add to
If however, you *really* want to keep your shapes as being seperate
types, then you'll want to invoke the class system (note, not the same
as OO classes).
class Shape a where
area :: a - Int
newtype Circle = C Int
instance Shape Circle where
area (C r) = pi * r^2
newtype
Ian,
Is there a way for GHC on OS X to find where it was run from, so that it
can find package.conf?
The command:
ghc --print-libdir
should do it.
Cheers,
Chris.
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
Hi David,
A let clause would work fine here:
someFunction ls a b c = let listLen = length ls
someAuxFunction x y = ... listLen ...
someOtherFunction x y = ... listLen ...
in
... listLen
Hi Neil,
Why not:
exp = let blah = g 1000
in (fst blah, snd blah)
Yes, fair enough.
Where's always get desugared to let's, so where's are never more efficient.
Interesting. I'm thinking a where-to-let refactoring and its converse may
make useful routine refactorings for HaRe.
Hi,
I was given a quandary this evening, suppose I have the following code:
module Test1 where
import qualified Data.Map as Map
testFunction :: Ord a = Map.Map a b - Map.Map a b - a - (Maybe b,
Maybe b)
testFunction m0 m1 k = (lookup0 k, lookup1 k)
where
Yes, using a ghc extension of scoped type variables. In the signature
of testFunction, if you explicitly quantify all your variables with
forall, then they are visible in the where clause (and elsewhere in
the function).
Perfect! But how come if I have:
testFunction :: forall a b. Ord a =
I get:
Test1.hs:6:34: parse error on input `='
Is the syntax incorrect?
Scrap that, I forgot to enable the glasgow extensions. It's been a long
day. *sigh* :)
Chris.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hi Peter,
Mmm, yes of course... blush...
But shouldn't
f ~(x:xs) = rhs
give a compile-time error since neither x nor xs is used in the right
hand side, and hence nothing will ever get pattern matched when this
function is called, which clearly indicates a mistake? That is, if I
f ~(x:xs) = x + 2
f ~[] = 42
Then f [] would give a complie error:
Irrefutable pattern failed for pattern (x : xs)
Sorry, that should be *runtime* error!
Chris.
Hope that gives some insight.
Chris.
Oh well, the way it is now is also easy to get used to, one just has to
know
It seems GHC does give a warning at compile-time about it, so you did
get it right the first time :-)
Well the warning happens at compile time certainly. But the irrefutable
pattern error only occurs at runtime.
cmb21$ ghc --make Main.hs
[1 of 1] Compiling Main ( Main.hs, Main.o )
Hi Miguel,
See, in let or where constructs you don't have a choice; you can't do
different things depending on whether some value is Just x or
Nothing. Therefore, there is no need to perform pattern matching
strictly.
This is not entirely true. This is actually one of those niches in Haskell
Hi Isaac
or
f x = let
g (Just x) = x
g Nothing = error Nothing
in g x
That's interesting, thanks!
Chris.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
I tried vital, and at first sight it is very nice, but they only support a
very limited subset of Haskell, perform no type checking at all, don't
support the indent rule, etc... Anyway it is an amazing piece of work.
I believe that type-sensitive manipulation was certainly being
investigated;
Definitely! It's really cool stuff. But something like that for real Haskell
(e.g. GHC) would be even better :) I could be an offline downloadable
application. It would be a very nice tool: create postscript (or PDF, or
LaTex, whatever rich text format) documents with Haskell boxes inside.
Hi,
Is lazy evaluation necessary for a functional language to remain
functional?
The reason I ask is that because it violates beta-reduction, and also
referential transparency (I think). In haskell, we can transform:
g x + f x
into:
f x + g x
as both f and g do not change the parameter x.
, but it doesn't break
referential transparency.
Jeremy
On 9 Aug 2007, at 10:30, C.M.Brown wrote:
Hi,
Is lazy evaluation necessary for a functional language to remain
functional?
The reason I ask is that because it violates beta-reduction, and also
referential transparency (I think
Hi Jon,
On Thu, 26 Jul 2007, Jon Harrop wrote:
If you have a boolean-or expression:
a || b
will a be evaluated before b in Haskell as it is in other languages?
Yes, I believe it is defined thus:
True || _= True
_|| True = True
_|| _= False
Therefore it is strict in
Hi Juozas,
-
type Parser a = String - [(a, String)]
return :: a - Parser a
return v = \inp - [(v, inp)]
failure :: Parser a
failure = \inp - []
item :: Parser Char
item = \inp - case inp of
[] - []
(x:xs) - [(x, xs)]
parse
Hi Tope,
When I tried to compile it as instucted on the webpage ( $ ghc -o hello
hello.hs), I got this error message.
are you actually typing in that '$' into the command prompt? try leaving
out the '$' and just type ghc -o hello hello.hs.
Chris.
Hi Kenny,
\begin{code}
main = do
session - GHC.newSession GHC.JustTypecheck (Just Test.hs)
dflags1 - GHC.getSessionDynFlags session
(dflags2, packageIds) - Packages.initPackages dflags1
GHC.setSessionDynFlags session dflags2{GHC.hscTarget=GHC.HscNothing}
let name =
Hi,
I was wondering if there was an easy way to pretty print the result of the
type checker from GHC. I basically want the format that GHCi spits out,
rather than a type annotation with qualified types. I know I can knock up
a parser that removes the qualifiers, but I was wondering if there was a
Hi Jahannes,
I don't want to make a big research project out of this,
rather I think of quickly putting together a prototype
that proves the concept.
I figure it could be distilled from some existing refactoring suite,
or be manufactured from existing building blocks.
Well, HaRe -- the
Hi Simon,
Mainly this is due to modularity: many of the library packages can be built
entirely separately from GHC, so their configure scripts are designed to be
standalone.
Yes, I guess it would be a fair bit of work to have it check that you are
building the whole of GHC as opposed to
Hi Fernando,
[EMAIL PROTECTED] ghc-6.6.1]# ghc
/usr/local/lib/ghc-6.6.1/ghc-6.6.1: error while loading shared libraries:
libreadline.so.4: cannot open shared object file: No such file or directory
#
So, I conclude that Haskell is not ready for prime time, if it cannot
install itself
Hi,
I've noticed that when you run ./configure on a ghc build lot's of
repetition occurs. A lot of the time the same checks are being performed for
each configure file in the ghc hierarchy. Could it be possible if some of
these checks could be done once at a high level and then subsequent
Hello,
I've been trying to build the ghc-devel package (6.7) from macports.
However the build seems to fail half through. Specifically when running
the setup for base-2.1:
configure: Using compiler: ../../compiler/ghc-inplace
configure: Compiler flavor: GHC
configure: Compiler version:
Hi,
I am observing some rather strange behaviour with writeFile.
Say I have the following code:
answer - AbstractIO.readFile filename
let (answer2, remainder) = parseAnswer answer
if remainder == answer2 ==
then do
AbstractIO.putStrLn $ completed
else do
AbstractIO.putStrLn
= if x==x then x else x
Seems to do the trick.
Thanks!
Chris.
On 04/02/07, C.M.Brown [EMAIL PROTECTED] wrote:
Hi,
I am observing some rather strange behaviour with writeFile.
Say I have the following code:
answer - AbstractIO.readFile filename
let (answer2, remainder
Hi,
I was wondering when ghc-6.6.1 will be released? I am asking because a
patch has been made to the ghc repo to allow multple calls to the
ghc.newSession within the API and HaRe depends on this.
Regards,
Chris.
___
Glasgow-haskell-users mailing list
Hi,
I have recently tried to compile the 6.6 version of ghc from the darcs
repository.
I followed the intructions to pull ghc from the repository:
darcs get --partial http://darcs.haskell.org/ghc-6.6/ghc
cd ghc
chmod +x darc-add
./darcs-add -extra pull
The build process seems to get past stage
Hi,
It's true that this is the typical way of learning Haskell, but I for
one think it's a bad way of learning Haskell.
Very few real world programs get by without the impure stuff, so if
you give the newbie the impression that it isn't there (by postponing
it) there's a chance he'll run
Hi,
On the contrary, I think it's an excellent way of learning Haskell.
I'm writing a lot of useful Haskell code with only one IO action
(interact). I don't think I could reasonably construct an
introductory problem that couldn't be solved with it, and I haven't
yet found an application for
line everything works. Something very subtle that
I compeletely overlooked.
Thanks for your help.
Chris.
On Sat, 25 Nov 2006, Ian Lynagh wrote:
Hi Chris,
On Fri, Nov 10, 2006 at 04:15:10PM +, C.M.Brown wrote:
I am currently in the process of porting some of the Haskell
Refactorer
Hi,
I got this working on Mac OS X. I had to download media player 9:
http://www.microsoft.com/windows/windowsmedia/software/Macintosh/osx/default.aspx
This contains the WMV3 codec.
Cheers,
Chris.
On Fri, 24 Nov 2006, James William Pye wrote:
On Fri, Nov 24, 2006 at 10:26:38AM +0100,
Hi,
I am currently in the process of porting some of the Haskell
Refactorer (HaRe) over to ghc 6.6. Part of HaRe requires the API and until
now I've been content with using th 6.5 API. However, since I've started
the switch I've noticed some strange problems and the latest is I am
getting the
Hi Greg,
I have just been trying to install ghc 6.6 using Darwin Ports, but the
search facility can't find ghc-6.6. :
sudo port selfupdate
DarwinPorts base version 1.320 installed
Downloaded MacPorts base version 1.320
The MacPorts installation is not outdated and so was not updated
selfupdate
76 matches
Mail list logo