On Thu, Sep 13, 2012 at 10:29 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Hi,
Simple usage, I could make an instance of Enum to UTCTime, so
[utcTime..] could work. But that is so stiff. How if sometimes I want
to step by 1 min, sometimes I want to step by 1 sec?
So I
Ok, I've added the support for urxvt.
Bear in mind that it partially support urxvt, though: it works fine if you
run GVim or Vim outside an already running tmux session, otherwise it won't
start.
The problem is due to the fact urxvt believes that the new session is
launched within the running tmux
C K Kashyap ckkash...@gmail.com writes:
Is it just me or is Hackage indeed been going down more frequently of late?
It's not just you.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Sorry the typo, the variable is $TMUX and controls the nesting ot tmux
session. It turns out that if affect not only urxvt but also xterm and
gnome-terminal.
Perhaps it could be useful to unset it programmatically, I'll keep you
posted if I find a workaround.
A.
On 14 September 2012 06:14,
Consider using the time-lens package.
import Data.Time.Lens
import Data.Lens.Common
List comprehension style:
[modL seconds (+ fromIntegral n) t | n - [0..]]
[modL minutes (+ n) t | n - [0..]]
(you need fromIntegral for seconds, because it is of fractional type in
Data.Time).
iterate
This is nice. Thanks to all.
On Fri, Sep 14, 2012 at 4:03 PM, Roman Cheplyaka r...@ro-che.info wrote:
Consider using the time-lens package.
import Data.Time.Lens
import Data.Lens.Common
List comprehension style:
[modL seconds (+ fromIntegral n) t | n - [0..]]
[modL minutes (+ n)
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hello cafe,
I have a question wrt. to GADTs and type families in GHC (7.6.1).
I'd like to transform a value of an ADT to a GADT. Suppose I have the
simple expression language
data Exp = Lit Int | Succ Exp | IsZero Exp | If Exp Exp Exp
and the
Hi Cafè,
I'm glat to annouce the third major improvement of my VIm plugin Cumino:
https://github.com/adinapoli/cumino
This one is a juicy one. If you have a sandboxed environment enabled (e.g.
one created with Hsenv) and you start vim from the same shell,
Cumino will automatically uses at
On Fri, Sep 14, 2012 at 12:45 PM, Florian Lorenzen wrote:
I'd like to transform a value of an ADT to a GADT. Suppose I have the
simple expression language
data Exp = Lit Int | Succ Exp | IsZero Exp | If Exp Exp Exp
and the GADT
data Term t where TLit :: Int - Term Int TSucc :: Term
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Dear Sean,
thanks for your solution. It in the documentation of unsafeCoerce it
says: It [unsafeCoerce] is generally used when you want to write a
program that you know is well-typed, but where Haskell's type system
is not expressive enough to prove
On Fri, Sep 14, 2012 at 2:01 PM, Sean Leather leat...@cs.uu.nl wrote:
On Fri, Sep 14, 2012 at 12:45 PM, Florian Lorenzen wrote:
I'd like to transform a value of an ADT to a GADT. Suppose I have the
simple expression language
data Exp = Lit Int | Succ Exp | IsZero Exp | If Exp Exp Exp
On Fri, Sep 14, 2012 at 2:27 PM, Erik Hesselink wrote:
I don't think this is safe. What will happen if you evaluate
typecheck (Lit 1) :: Maybe (Term Bool)
Indeed! Silly me. Caught by the lure again. Thanks.
Regards,
Sean
___
Haskell-Cafe mailing
Dear Florian,
On Fri, Sep 14, 2012 at 6:45 AM, Florian Lorenzen
florian.loren...@tu-berlin.de wrote:
Now, I'd like to have a function
typecheck :: Exp - Maybe (Term t) typecheck exp = ...
that returns the GADT value corresponding to `exp' if `exp' is type
correct.
If you can add “deriving
On Fri, Sep 14, 2012 at 2:27 PM, Erik Hesselink hessel...@gmail.com wrote:
In general, I think you have to work inside an existential. So you
hide the type of the parsed Term inside an existential. If you want to
apply functions to this Term, you unpack, call the function, and
repack.
Maybe I
Groundhog has design very similar to Persistent, so I would choose it
for comparison. I don't have much of experience of using Persistent,
so some facts may be inaccurate for the newer versions. The facts are
based mostly on the Persistent documentation. You may be also
interested in comparison of
I've gotten mixed feedback from Reddit for my tutorial. It provides an
overview of how functional and declarative programming in Haskell empower
baddies, increasing the accuracy and efficiency of their atomic
superweapons. What do you guys think of my tutorial, Haskell for the Evil
Genius
On Fri, Sep 14, 2012 at 12:13:15PM -0400, Andrew Pennebaker wrote:
I've gotten mixed feedback from Reddit for my tutorial. It provides an
overview of how functional and declarative programming in Haskell empower
baddies, increasing the accuracy and efficiency of their atomic
superweapons. What
Hi Andrew,
To save others the search, here's the/a reddit URL:
http://www.reddit.com/r/programming/related/nhnyd/nfa_in_a_single_line_of_haskell/.
The terribly misleading/mistaken remarks on fib memoization are still in
your post. As hammar commented on reddit commenter, you're not memoizing in
On 13 September 2012 20:29, wren ng thornton w...@freegeek.org wrote:
On 9/12/12 5:37 PM, Francesco Mazzoli wrote:
At Wed, 12 Sep 2012 12:04:31 -0300,
Eric Velten de Melo wrote:
It would be really awesome, though, if it were possible to use a
parser written in Parsec with this, in the
A summary of the changes I've included so far:
Under Declarative, you aren't creating a named expression, 2 + 2, really.
You are redefining (+).
Noted and reflected in the new version.
Under Lazy, your example of binding fib 30 is not a good example of
memoization. With memoization you
On 12-09-14 05:18 PM, Andrew Pennebaker wrote:
One thing I want to double check is that Haskell does, in fact,
automatically memoize all pure function calls. Is this true?
A simple back-of-envelope calculation that immediately raises doubts:
2 seconds on a 2 GHz computer is 4x10^9 clock
On Fri, Sep 14, 2012 at 05:18:24PM -0400, Andrew Pennebaker wrote:
A summary of the changes I've included so far:
Under Declarative, you aren't creating a named expression, 2 + 2, really.
You are redefining (+).
Noted and reflected in the new version.
It may not be obvious to readers when
Experiment #4:
fib :: Int - Int
fib n = mem !! n
mem :: [Int]
mem = map aux [0..]
-- remark: even [Int] is not a very efficient data structure for this
aux 0 = 0
aux 1 = 1
aux n = mem!!(n-1) + mem!!(n-2)
main :: IO ()
main = mapM_ (print . fib) (replicate 10 30)
Question: How
Well, to make it short, I liked it!
As suggestions, little things like first class functions and partial
application can be easily introduced.
For example the line:
map (+1) [1..10]
contains these concepts and it very short and expressive.
On the story side, why not introducing a character? This
On Fri, Sep 14, 2012 at 2:18 PM, Andrew Pennebaker
andrew.penneba...@gmail.com wrote:
A summary of the changes I've included so far:
Noted and reflected... I'm trying to convey to an audience largely
composed of Java and C++ fanatics how Haskell records are much better than
OOP, how GADTs
But, Haskell records aren't better than OOP.
I am not trying to be controversial here -- Haskell records would
naturally implement prototype-based OOP, like JavaScript uses, if they
(Haskell records) weren't so useless. This is basically why lenses were
designed (i.e., to make consistent
On Fri, Sep 14, 2012 at 8:23 PM, Andrew Pennebaker
andrew.penneba...@gmail.com wrote:
[snip..]
Does anyone know of a brief introductory Haskell tutorial that engages
monads? LYAH covers monads, but it does so after a few chapters of simpler,
pure function Haskell coding. I know of some brief
Everyone in the Haskell cafe probably has a secret dream to give the
best five minute monad talk. Challenge: get someone to have a
competition at one of the conferences where students all give their
best five minute monad talk and try to find the most comprehensible
one!
Haha, maybe
On Fri, Sep 14, 2012 at 9:08 PM, Andrew Pennebaker
andrew.penneba...@gmail.com wrote:
Given that Maybe and Either don't modify state, nor do they communicate
with outside interfaces, nor do they specify computation ordering, I don't
understand why they're implemented as monads. Why not a
I find the Monad instance for Maybe and Either very useful. You can do things
like the following (which technically only uses the Applicative instance):
Prelude Control.Applicative (*3) $ (+2) $ Just 1
Just 9
Prelude Control.Applicative (*3) $ (+2) $ Nothing
Nothing
Prelude Control.Applicative
Challenge: get someone to have a competition at one of the conferences
where students all give their
best five minute monad talk and try to find the most comprehensible one!
Challenge accepted http://www.yellosoft.us/5min/.
___
Haskell-Cafe mailing
31 matches
Mail list logo