Hello,
I'm implementing a command which manipulates files both on Unix/Mac
and Windows. I was very surprised because there is not
getStatusChangeTime function. So, I wrote it with CPP.
http://github.com/kazu-yamamoto/Mew/blob/master/bin/hs/Stat.hs
Another problem is that since '\\' is
Hello,
Clarify this, please. Used by who?
It is by System.FilePath.
Windows: combine home bob == home\\bob
Both Cabal and filepath libraries do have functions operating on
filepath strings. Eg filepath can split them.
I'm want to use regular expressions for results of 'combine', for
Hello,
(=$) :: Monad m = Enumeratee ao ai m b - Iteratee ai m b - Iteratee ao m
b
enum =$ iter = joinI (enum $$ iter)
($=) :: Monad m = Enumerator ao m (Step ai m b) - Enumeratee ao ai m b -
Enumerator ai m b
($=) = joinE
Hello cafe,
Let me announce a maintenance command of Haskell cabal packages.
http://www.mew.org/~kazu/proj/cab/en/
cab is a MacPorts-like maintenance command of Haskell cabal
packages. Some part of this program is a wrapper to ghc-pkg and
cabal.
If you are always confused due to
whoah, it has uninstall!!! awesome!
It just unregisters libraries not delete them actually. But I guess it
is enough for you.
The cabal-delete command does delete libraries and I'm planning to
integrate cab and cabal-delete. But the author of cabal-delete
is now suffering from the Tsunami in
Hello,
Have you read this?
http://www.reddit.com/r/haskell/related/f3ykj/
psa_use_cabaldev_to_solve_dependency_problems/
I did know this page. I will read it later. Thank you.
cabal-dev is a wrapper around cabal. It creates the directory
cabal-dev in your current directory when you run
Hello,
cabal-dev is a wrapper around cabal. It creates the directory
cabal-dev in your current directory when you run commands.
Yes, I know. But when I typed cabal-devel install on a package
directory, nothing happened.
Can you give a specific example? Surely *something* happened :)
I
My workaround was to create a link:
ln -s ~/Library/Haskell/repo-cache ~/.cabal/packages
I have already done it. :)
--Kazu
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hello cafe,
Let me announce cab version 0.1.2. This version integrates
cabal-dev as well as cabal/ghc-pkg. So, you can use a sandbox for
your development.
http://www.mew.org/~kazu/proj/cab/en/
Here is the short explanation from the page above:
cab is a MacPorts-like maintenance
Currently what I do is declare a signature for helper, and then if it
gets a type error try to figure out how to fix it. It's usually not
very hard, but it would be slick to have the signature filled in
automatically.
Try ghc-mod on Hackage if you are an Emacs user.
If GHC can guess the
I made a mistake. Use M-t instead of C-cC-t.
Currently what I do is declare a signature for helper, and then if it
gets a type error try to figure out how to fix it. It's usually not
very hard, but it would be slick to have the signature filled in
automatically.
Try ghc-mod on Hackage if
Hello,
When I install cabal-dev and cab first and then re-install everything
with cab instead of cabal the issue with re-installing already
installed packages described above disappears and only an unknown
symbol message related to the correctly found installed cairo package
remains. So is
Hello,
thanks I wanted to mention that the unknown symbol error is very
likely not related to the cab tool as the same error appears, when
using the cabal - tool. I guess we can ignore it even in the context
of my main question, sorry for being to verbose. What I found more
interesting is,
Erik,
I have done stuff like this before in C++ and Ocaml, so the mechanics
are not a mystery. However I would like as much as possible to make
use of existing Haskell libraries to cut down the development time.
I recommend wai and warp which are available on Hackage. I asked
Michael, the
Hello libraries and cafe,
We (Hirai and I) would like to tell you our paper relating to
Data.Set and Data.Map. Balancing Weight-Balanced Trees is now
accepted and will appear in Journal of Functional Programming.
The camera-ready version of the paper is available from:
Hello,
I would like to know how to change a process name in Haskell. When we
are programming in C, we can change it by overriding argv on Unix.
But I cannot find the same way to do in Haskell. Can anyone suggest
how in Haskell? I'm not talking about the result of
System.Environment.getProgName
Hello Cafe,
I would like to have an efficient implementation of the chop function.
As you guess, the chop function drops spaces in the tail of a list.
chop foo bar baz
-foo bar baz
A naive implementation is as follows:
chopReverse :: String - String
chopReverse =
Hello,
Of course, I use ByteString or Text for real programming. But I would
like to know whether or not there are any efficient methods to remove
a tail part of a list.
--Kazu
From: Thomas DuBuisson thomas.dubuis...@gmail.com
Subject: Re: [Haskell-cafe] efficient chop
This was a recent
Hello,
My friend reached the following version:
chop :: String - String
chop = foldr go []
where
go x xs
| isSpace x null xs = []
| otherwise= x:xs
This version is faster than the reverse version in most cases. The
point is checking isSpace first and falling into
You can find the results of my friend:
https://gist.github.com/1215660
Please ignore the Japanese text. Please read the code and the results.
I'm not sure why you had the different result.
--Kazu
This was exactly my first attempt on rewriting your foldr version.
Unfortunately, it
Hello,
To those who are in Tokyo for ICFP:
The typhoon is likely to come after 16:00 today. Many students and
workers will go home earlier this afternoon. It's Japanse style.
If typhoon comes, umbrella does not work. Please stay in your
building. You should understand all traffic transportation
Hello,
My fix intended that Haskell code behaves the same in various
environments. That is, one socket catches both IPv4 and IPv6. And the
fix works even in both IPv4-only env and IPv6-only env.
Johan's observation is correct. Network.listenOn is alreay fixed but
Network.Socket.listen, which
Hi,
We should consider how we fix this. Right now N.S.listen just wraps the
underlying system call. Is that the right place to set socket options? Perhaps
we should set them when creating the socket instead?
Yes, of course.
If I remember correctly, this option works only between socket() and
Hello,
Sorry for the delay but I made a patch and sent a pull request:
https://github.com/haskell/network/pull/18
After consideration, I realized that Johan's opinion is better.
Please read the comment of this request above.
When the next network package will be released, this problem
Hello,
I'm measuring performance of the insertion operation of red-black
trees. For input, three kinds of [Int] are prepared: the increasing
the order, decreasing order, and random.
The random case is 4 or 5 times slower than the others. I'm afraid
that my program also measured the cost of
Greg,
The code looks ok to me -- you've deepseq'ed the list, and forcing it
to whnf should force the deepseq. Also, criterion runs your benchmark
many times, if your code was measuring the RNG time it would only
happen once. This would show up in the criterion output as an
unusually large
Hello,
I have just released ghc-mod v1.10.3. C-cC-t of this version was
powered by Hideyuki Tanaka.
The old implementation just show the type of the current expression on
Emacs. Howver, the new implementation first show the type of the
current expression and the expression is highlighted. If
Hello,
I recently started using test suite sections of cabal but it soon
appeared very inconvenient to me.
1) test data files
If I want to include test data files into package, I have to
enumerate all test files since the usage of '*' is restricted.
I just want to specify the top
Hello,
eagletmt implemented a Vim plugin for ghc-mod:
https://github.com/eagletmt/ghcmod-vim
Happy Haskell programming on Vim!
--Kazu
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
2) build-dependency
I need to repeat all build-dependency of a library section to
a test suite section. Specifying the library itself to
build-dependency of a test suite section does not work.
This violates the DRY philosophy.
You may specify the same library as a dependency given
Hello Felipe,
If we have separate directories, then you can build-depends:
own-package. This means that on the test suite's build-depends you
need to list only the dependencies that the test-suite needs, not
every dependency. Also, you don't need to constrain the version of
any duplicated
Hello,
Looking at IntMap's left-biased 'union' function [1], I noticed that the
complexity is O(n+m) where n is the size of the left map, and m is the size of
the right map.
Since insertion [2] is O(min(n, W)) [ where W is the number of bits in an Int
], wouldn't it be more efficient to
Hello,
I have released ghc-mod v1.10.10. With this version, you can
expnad Template Haskell by using C-cC-e on Emacs.
http://mew.org/~kazu/proj/ghc-mod/en/
Enjoy!
--Kazu
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hello,
A twitter election on favorite programming language was held in Japan
and it appeared that Heskell is No. 10 loved language in Japan. :-)
http://twisen.com/election/index/654
Regards,
--Kazu
___
Haskell-Cafe mailing list
Hello cafe,
Translating Learn You a Haskell for Great Good into Japanese was
finished and will be published on 22 May. I guess it's worth watching
its cover page:
Hello Leon,
Out of curiousity, was this a plurality election (vote for one), or an
approval election (vote for many)?
Vote for one.
This application requires twitter login.
--Kazu
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hello,
I think the Japanese title is in a similar spirit as the original one.
Breaking it down:
Sugoi Haskell tanoshiku manabou!
sugoi - awesome (rather colloquial)
tanoshiku - while having fun
manabou - let's learn
Yes, exactly.
Sugoi is a frank word which we cannot use in thesis.
Hello,
Could you please answer my concerns about the license under which LYAH
is distributed? (see my initial reply to the thread)
Additionally, under what license is your translation work re-distributed?
What I know is:
- The Japanese publisher bought the translation license from the
Hello cafe,
I have released Mighttpd 2.6.0:
http://mew.org/~kazu/proj/mighttpd/en/
Some users started using Mighttpd 2 and I was requested to implement
missing features for real world operation. So, I implemented the
following features in Mighttpd 2.6.0:
- Route file reloading
-
Hello Cafe,
This is just FYI.
We Hasekell community in Japan will have an event called Haskell Day
2012 on 27th May to cerebrate the publication of the Japanese version
of Learn you. 180+ people have already registered:
# This page is written in Japanese.
Hello cafe,
I would like to announce two parallel libraries from Japan.
- Paraiso (http://hackage.haskell.org/package/Paraiso)
The purpose of this library is to design a high-level language for
implementing explicit partial-differential equations solvers on
supercomputers as well as
Hello,
After releaseing new Haskell Platform, many people can now use
RawFilePath (e.g. ByteString) for System.*. However, there is no
System.FilePath.ByteString which manipulates RawFilePath.
How do you guys manipulate RawFilePath as file path?
Is there a plan to implement
Hello,
Are there any ways to see if a value is a thunk or memorized?
I would like to have a function like:
isThunk :: a - IO Bool
I'm implementing some data structures described in Purely Functional
Data Structures and want to check my implementation is correct.
E.g.
Hello,
vacuum allow that and much more though I don't know if it still works
correctly on GHC 7.4. Anyway your isThunk is
isThunk a = fmap GHC.Vacuum.ClosureType.isThunk GHC.Vacuum.closureType
Great. I confirmed that this works with GHC 7.4.
# I removed the a parameter.
Thank you very
Hello,
The issue is unfortunately more to do with sysadmin resources than
server hardware; there's noone with the time to actively manage the
server and make sure that it's running well. Any ideas for improving the
situation would be gratefully received.
I don't know about the current
Hello,
The stable branch of the network library includes the following code:
#if !(MIN_VERSION_base(4,6,0))
I cannot compile the stable branch with HP 2011.4.0.0 on Linux 2:
Preprocessing library network-2.3.0.14...
BSD.hsc:115:23: error: missing binary operator before token (
Hello from Copenhagen,
In last may, I wrote an article about Mighttpd in Japanese because a
PR staff of IIJ asked me to do so. Since this article got popular in
Japan, the PR staff decided to translate it into English. The English
version is now open to the public:
Hi,
Is it true that writing a simple server using forkIO now integrates
native event loops implicitly?
Yes.
IO manager handles event driven stuff. Thanks to this, we can enjoy
(light) thread programming using forkIO.
One last question. When writing C code, using epoll apis explicitly
can
All system calls issued from the network package use non-blocking.
You don't have to worry about blocking at all.
Almost. Especially when interfacing with C code you should include the
-threaded option to GHC to link against the multi-threaded run-time
system. Otherwise your Haskell code
Hello,
Non-threaded RTS would block FFI to C code. But it does not block file
descriptors and sockets because the scheduler uses select(). To my
experience, *simple* network programming with non-threaded RTS also
works well except the case where we reach the limit of file
descriptors for the
Michael,
Having looked through the code for the process package a bit, my
initial guess is that this is being caused by a signal being sent to the child
process, but I'm not familiar enough with the inner workings to confirm or
disprove this guess.
To remove that comment for finally, you
My understanding is that System.Process avoids these problems by doing
all the setup around forking a command in C code. I've banished
forkProcess from my code base entirely, except for a double fork I need
to daemonize, and I don't even trust that call. :/
I think you are right. forkProcess
Hello cafe,
I'm now studying Trie in Okasaki's Purely Functional Data Structure.
Attached is the program in its appendix. I cannot understand how to
use empty, look and bind. For instance, if I type 'look empty',
I got an error:
look empty
interactive:2:1:
No instance for (FiniteMap m0
Andres,
The code you've listed shows how to go from an already existing
instance of class FiniteMap to an instance for the same class that
adds a trie structure on top of the underlying finite map
implementation. You have to add a base instance to the code so that
it can work. For example,
Hello,
This is just for your information.
Haskell Advent Calendar is going on in Japanese Haskell Community:
http://partake.in/events/45a01d39-af5e-42f1-91c7-e8fcc91db244
One article is evaluated lazily but other articles are in time. :-)
--Kazu
Happy new year from Japan.
A young talented guy, @fumieval, has released Monaris, a Tetoris clone based
on OpenGL. You can install it:
% cabal install Monaris
To my surprise, this game is implemented with free Monad. ;-)
Regards,
--Kazu
___
Hello,
The following blog post by Joyent is worth reading:
http://joyent.com/blog/diy-vs-as-a-service-with-memcachier
We don't really believe in Node.js (Go Haskell are our
choices), so that is a small concern to us, but everyone has
their failings.
--Kazu
Hello cafe,
Just FYI:
I wrote an tutorial, Up-front Unit Testing in Haskell. It is about
how to use doctest, hspec and Cabal.
Enjoy!
--Kazu
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
#Resending due to the lack of URL.
Hello cafe,
Just FYI:
I wrote an tutorial, Up-front Unit Testing in Haskell. It is about
how to use doctest, hspec and Cabal.
https://github.com/kazu-yamamoto/unit-test-example/blob/master/markdown/en/tutorial.md
Enjoy!
--Kazu
Where can we find it, Kazu? =)
Oops. Thank you for pointing out.
Here it is:
https://github.com/kazu-yamamoto/unit-test-example/blob/master/markdown/en/tutorial.md
--Kazu
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hello,
Many texts explain the following Fibonacci code:
fibs :: [Integer]
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
But this code is very slow because evaluation of (+) is done
lazily. If we have the following strict zipWith', the code above
becomes much faster.
zipWith' f (a:as) (b:bs) = x
Hi,
zipWith' would [I haven't tested, but I'm rather confident] make a difference
if
you benchmarked
bench name (whnf (fibs !!) 10)
etc.
Yes. fibs is slow if used with !!.
--Kazu
___
Haskell-Cafe mailing list
Right, I'm not arguing that it's impossible to produce a difference,
but I think that if you're defining the sequence of fibs, the most
likely scenario might be that you're actually interested in a prefix,
and more importantly, you can still, from the outside, force the
prefix even if you're
Hi,
When I have a cabal file with a library and an executable depending on the
library (for example here
https://github.com/bitonic/kant/blob/master/kant.cabal), ghc-mod is not
happy,
complaining in every file that
Error:command line: cannot satisfy -package kant
Where ‘kant’ is
The ‘kant’ package is the package I’m developing and using ghc-mod on.
Yes. I understand it.
It includes both a library and an executable. The executable target
has ‘kant’ as a dependency.
What I asked is whether or not the kant library is installed by
cabal.
To edit a Haskell file for
Well installing it has the big problem that each time I make a
change to the interface I have to manually re-install, and this
happens often since I’m in an early stage...
I'm not saying that you should install it. But I just want to know
your situation.
Right, but this is surely doable
Francesco,
I can confirm that 1.11.1 works.
I think I fixed this problem.
Would you try the master branch?
https://github.com/kazu-yamamoto/ghc-mod
--Kazu
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Now I get another error:
Error:command line: cannot satisfy -package wl-pprint
even if ‘wl-pprint’ is installed, and ‘cabal configure; cabal build’ runs
fine.
It seems to me that you installed multiple GHCs and wl-pprint is not
installed for one of them. Is my guess corrent?
--Kazu
Nope :). I have one ‘ghc’, and this is my ‘ghc-pkg list’:
http://hpaste.org/82293. ‘ghci -package wl-pprint’ runs just fine.
Uhhhm. Are you using sandbox?
--Kazu
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hi Niklas,
* PSQueue throws a stack space overflow if you try to put in 10
* Ints
A slightly different implementation is used in GHC:
https://github.com/ghc/packages-base/blob/master/GHC/Event/PSQ.hs
Could you test it? If this code also has the same problem, I need to
fix it.
Hi Niklas,
No, it does not stack overflow, and it seems to perform slightly better
than the other implementations; it also doesn't suffer from the toList
slowness problem as does listlike.
Thanks. It's nice.
However, it is probably not as generally usable as it hardcodes the
priorities to
Hi,
See here:
https://github.com/nh2/psqueue-benchmarks/blob/db89731c5b4bdd2ff2ef81022a65f894036d8453/QueueBenchmark.hs#L44
If I fromList 100 entries into the queue, it stack space overflows.
Are you sure that this is a bug of GHC PSQ?
I think that replicateM _GHC_CRASH_N causes
Hi cafe!
I have released ghc-mod v2.0.1. From this version, ghc-mod provides
the ghc-mod library in addition to the ghc-mod command:
http://hackage.haskell.org/package/ghc-mod
http://mew.org/~kazu/proj/ghc-mod/en/
Enjoy!
--Kazu
___
Hi Niklas,
Just one note: The emacs link on the left is not found.
Fixed. Thank you.
--Kazu
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hi,
While we're on topic of ghc-mod, why does the emacs front-end give
`Cannot guess type' when the point is on the very first letter of the
function?
foo 5 = 2
^
foo x = 3
Is this a feature or a bug? It does fine on the second (or any) letter
after that point.
I think this is a spec
Hi all,
I have just uploaded ghc-mod v3.0.0 to Hackage. In this version,
ghc-mod supports the sandbox feature of cabal-install. Instead, it
stopped supporting cabal-dev.
If you want to use ghc-mod v3.0.0, I would recommand to install
cabal-install 1.18. The sandbox in your package is
Alan,
Is this backward compatible with older versions of Cabal? I am considering
whether to migrate HaRe to use this, I would prefer not to have it then
fail to work on older systems that are constrained not to be able to update
Cabal.
The sandbox is a feature of cabal-install, not Cabal
Hi all,
I have released dns library version 1.0.0.
This version provides new APIs. Thus, version is now 1.0.0. The design
and implementation was done by Michael Orlitzky based on his
experience.
Enjoy!
--Kazu
___
Haskell-Cafe mailing list
Hi all,
Michael Snoyman, Andreas Voellmy and I are invited to write an article
about Warp to The Performance of Open Source Applications:
http://aosabook.org/en/index.html
It is now open to the public including our article.
http://aosabook.org/en/posa/warp.html
Enjoy!
--Kazu
79 matches
Mail list logo