Offsite Discussion
Projects that depend on the vty package?
Hello,
For further development of the vty package I'm really only paying
attention to the requirements that fall out of the Yi project. Are
there any other projects that depend on the vty package?
In addition, the vty project has it's own wiki: http://trac.haskell.org/vty/
Right now there isn't much information there but it is a great place
to send bug reports or enhancement requests if you have them.
Cheers,
Corey O'Connor
Categories: Offsite Discussion
Gluing pipes
point-free compositions of curried functions. One might want to
transform both the first and second arguments, for instance, or only
the third argument, of a curried function. I've never known a
(non-cryptic) way to do this.
For example, given:
f :: a -> b -> c
g :: a1 -> a
h :: b2 -> b
I'd like to be able to write something like:
\ x y -> f (g x) (h y)
in a way that is both point-free and applicative. In other words, I'd
like to apply a function to "pipes" or transformers rather than to
values.
Recent posts by Conal Elliott [1,2] got me thinking about this again,
and I've found a simple solution.
I use two of Conal's combinators:
argument = flip (.)
result = (.)
And now we define:
infixr 2 ~>
f ~> g = argument f . result g
infixl 1 $.
($.) = flip ($)
Which lets us write:
-- transform both arguments
f $. g ~> h ~> id
-- transform just the second argument
f $. id ~> h ~> id
The name ($.) is chosen to indicate that this is (roughly) a
composition disguised as an application.
Categories: Offsite Discussion
gmp license == no commercial/closed source haskellsoftware ??
I've just discovered the GMP license problem. (see
http://hackage.haskell.org/trac/ghc/wiki/ReplacingGMPNotes)
From my understanding, the gmp is GPL, GHC statically links it on windows.
As a consequence, any program compiled using GHC must be distributed
under a GPL compatible license.
In the threads I've read, some workarounds are proposed on linux and
OsX, but I didn't see anything on windows.
Is the situation still the same ?
Does anybody know a work-around to make a closed-source programm in
haskell without violating the GPL ?
( Note this could block Haskell in our company. )
Categories: Offsite Discussion
handles and foreign C functions
Hello,
suppose a simple C function like this:
void printStuff(FILE *f)
{
fprintf (f, "Hello World\n");
}
In order to use it I need to import fopen and pass to it a Ptr CFile:
foreign import ccall unsafe "fopen" fopen :: CString -> CString -> IO (Ptr CFile)
foreign import ccall unsafe "fclose" fclose :: Ptr CFile -> IO CInt
foreign import ccall unsafe "printStuff" printStuff :: Ptr CFile -> IO ()
main =
withCString "tmp.txt" $ \cpath ->
withCString "w" $ \cmode -> do
cfile <- throwErrnoIfNull "fopen: " (fopen cpath cmode)
printStuff cfile
fclose cfile
How can I pass to printStuff a stdout FILE pointer?
If, for instance, I do:
foreign import ccall unsafe "stdout" c_stdout :: Ptr CFile
main =
withCString "tmp.txt" $ \cpath ->
withCString "w" $ \cmode -> do
printStuff c_stdout
I get a segmentation fault.
What am I missing?
TIA
Andrea
Categories: Offsite Discussion
Cabal and Hat?
Is it possible to use cabal to build the files that hat would need to
do tracing (i.e. .htx files)?
/M
Categories: Offsite Discussion
What causes <<loop>>?
I've already posted this mail on haskell-cafe, but apparently the
subject suggested a too simple question, so I try it here again. I am
picking up a discussion with the same topic from haskell-users on
8th November.
Thunks with reference on themselves was mentioned as main reason for
<.
Are there any other reasons?
I am trying to debug monadic code which stores state information in a
record maintaining several Data.Maps, but in vain so far. A state is
modified/changed in several steps by a compound function i.e.
changeA $ changeB $ changeC state
Could this also lead to a deadlock? If so, can I prevent this using CPS?
If the state transformation is the main purpose/computation of the monad
at all, is it better to use CPS? Is code using mtl, records or Data.Map
more prone to < or does this not matter at all. How can I
identify self-referencing thunks more easily? Is there any rule of thumb
to prevent <? Are there any less obvious newbie mistakes causing
< then the one above?
Categories: Offsite Discussion
Install Yi editor with GHC 6.10.1
Hi all,
I have install GHC 6.10.1 and Gtk2hs (darcs version) in Debian.
So i want to ask, have anyone install Yi (darcs version) with GHC 6.10.1
successfully?
And the best way to install darcs version Yi?
Thank you very much!
-- Andy
Categories: Offsite Discussion
ByteString web site papers
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe< at >haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion
Data.ByteString vs Data.ByteString.Lazy vsData.ByteString.Char8
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe< at >haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion
Deriving
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe< at >haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion
ghci and user private groups
User private groups are not an abnormal configuration, but
GHCi has such strict security that they are not allowed!
:; ghci
GHCi, version 6.10.1: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.Loading package integer
... linking ... done.Loading package base ... linking ... done.
*** WARNING: /Users/jsn/tmp is writable by someone else, IGNORING!
*** WARNING: /Users/jsn/tmp/.ghci is writable by someone else, IGNORING!
Prelude> :q
Leaving GHCi.
:; cd ../
:; ls -laR tmp/
tmp/:
total 4
drwxrwx--- 2 jsn jsn 102 2008-12-02 10:19 .
drwxr-x--- 49 jsn jsn 2890 2008-12-02 10:17 ..
-rw-rw---- 1 jsn jsn 159 2008-12-02 10:20 .ghci
I appreciate what you guys are trying to do, but I at the very
least, it should be permitted to use a GHCi that is group
readable/writable as long as the group name and user name are
the same. It would be preferable, however, to do away with the
restriction altogether.
--
_jsn
Categories: Offsite Discussion
Problem building HXQ on Mac OS 10.5.5
Hi,
I'm new to haskell and wonted to start tinkering a bit with this
language, specifically with HXQ. I have installed ghc with macports.
Now while building HXQ I get the following error:
Main.hs:20:9:
Not in scope: type constructor or class `C.SomeException'
Unfortunately I'm also new to Mac OS X. Before I developed on Linux.
It would be great, if someone could give me a hint.
Thanks,
Tobias
PS: Below the details
--
~$ cabal install hxq
Resolving dependencies...
'HXQ-0.11.0' is cached.
Configuring HXQ-0.11.0...
Preprocessing library HXQ-0.11.0...
Preprocessing executables for HXQ-0.11.0...
Building HXQ-0.11.0...
.
.
.
Loading package haskell98 ... linking ... done.
[20 of 21] Compiling Text.XML.HXQ.XQuery ( src/Text/XML/HXQ/XQuery.hs,
dist/build/xquery/xquery-tmp/Text/XML/HXQ/XQuery.o )
[21 of 21] Compiling Main ( Main.hs, dist/build/xquery/
xquery-tmp/Main.o )
Main.hs:20:9:
Not in scope: type constructor or class `C.SomeException'
cabal: Error: some packages failed to ins
Categories: Offsite Discussion
Using Data Parallel Haskell
As previously announced, GHC 6.10.1 includes a technology preview of
Data Parallel Haskell. However, so far, there was no documentation on
how to use it. That is different now:
http://haskell.org/haskellwiki/GHC/Data_Parallel_Haskell
Please keep in mind that this is a very preliminary version of the
system with limited functionality. However, we are very interested in
feedback from interested users.
Happy Vectorising!
Manuel
Categories: Offsite Discussion
The RiSE of Research in Software Engineering
Wolfram Schulte introduces us to the Research in Software Engineering (RiSE) group.
The RiSE group will start publishing weekly videos on Channel9. The videos will not only describe tools or technologies the researchers are working on, but they will also explain how the tools work through 'classroom' videos.
Screencast announcement at Channel9.
Page in Microsoft Research.
Categories: Offsite Discussion
Alex requirement for Setup.lhs
Dear all,
Hopefully, you will excuse me for my lack of experience with Cabal. I have
seen quite a few e-mails on this list that seem related to this issue, but my
specific error, I did not find. Thus:
Since installing 6.10.1, I can't perform Setup.(l)hs functions. The error
message I get is:
Setup.hs: alex is required but it could not be found.
The problem is that I get this error also when I try to "runghc Setup.lhs
build" alex (is the fact that "runghc Setup.lhs configure" does *not* produce
this error significant?). I'm running an OpenSuSE 10.3 installation on which
I can only install rpms from standard repositories. In these repositories,
there is no binary distribution of alex. How do I install alex from source
without requiring alex?
Regards,
Philip
Categories: Offsite Discussion
Sugestion for a basic Utf8 type.
Hi,
I would like to sugest a new basic type in Haskell. What if we had
something like this (with any other quoting character):
«Je ne parle pas français. Meu nome é Maurício. ¿Hablas español?»
This would be of type Utf8. I think now it is not a bad idea,
since Haskell source code is supposed to be utf-8. The internal
representation of this datatype would be a null terminated utf-8
byte vector. No standard operations would be defined on that type,
i.e., it would be a “communication standard” between everybody,
but module writers could develop different basic usage based on
operations on them using Foreign. (I think it would be dificult
to set default operations, since there are so many things you can
do with utf-8.)
Pros:
* There would be no doubt you can use utf-8 when using
this, since there's no conversion involved.
* Cleaner code on utf8 operations, maybe. There are many utf8
modules today with different goals in mind, I thing it would be
n
Categories: Offsite Discussion
Moving the messages for compiler to another file?
How about moving the messages for compiler to an additional file?
My motivation is that we often face a trade-off between
aesthetical(elegant code) and practical(efficient code).
Like pragmas and strictness annotations, I often feel they make the
source code ugly.
They don't affect the semantics of our programs, do they?
Some people would say this beautifying should be accomplished by an
editor, like hiding/showing option for those information.
But such separation has additional benefits.
For instance, making the source code more compiler-independent.
(yeah, this is not the case with language-extensions)
And we avoid dispersing those information among our lines. (or even files)
In some cases, it would be convenient.
I'm not sure if this idea is reasonable, reachable or just naive.
Suggestions?
Best regards
-nml
Categories: Offsite Discussion
GHC on Fedora 10 - getMBlock: mmap: Permission denied
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe< at >haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion
import
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe< at >haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion
The Knight's Tour: solutions please
Yes, there is a solution for n=99 and for n=100 for that matter --
which can be found under one second. I only had to make a trivial
modification to the previously posted code
I replaced foldl1 mplus with foldr mplus zero.
Here are the results:
for n=99, the first line of the board is
1 4 2885 214 309 6 311 216 307 8 315 218 305 10 319 220 303 12 2021
222 301 14 1727 224 299 16 1699 226 297 18 1561 228 295 20 1247 230
293 22 1227 232 291 24 1165 234 289 26 1007 236 287 28 965 238 285 30
775 240 283 32 759 242 281 34 625 244 279 36 559 246 277 38 543 248
275 40 455 250 273 42 435 252 271 44 407 254 269 46 377 256 267 48 365
258 65 50 63 60 67 52 55
time is 0m0.730s
n=100
1 4 205 9996 209 6 207 9940 211 8 9897 9900 213 10 9895 9906 215
12 9809 9880 217 14 9807 9740 219 16 9799 9072 221 18 8445 8864 223 20
8443 8378 225 22 8347 8352 227 24 8331 7860 229 26 7863 7844 231 28
7749 7754 233 30 7735 7742 235 32 7733 7320 237 34 677 640 239 36 597
568 241 38 535 540 243 40 517 500 245 42 473 452 247 4
Categories: Offsite Discussion