Hi,
2010/7/13 Gregory Crosswhite :
> Just out of curiosity, what work is being done in the data parallel
> haskell / repa projects regarding cache locality?
Hi,
I'm not knowledgeable at all about this, but for a technical
introduction to DPH, I found the following excellent. Locality
is a recurri
2010/7/26 Ryan Ingram :
> There are two types of datatype contexts; haskell'98 contexts (which I
> think are terrible), and GHC existential contexts (which I like):
See also "GADT-style" data type declarations [1] and full GADT's [2],
which both behave like GHC existential contexts mentioned above
2010/8/17 Luc TAESCH :
> May I ask you how you redact your answers and which toolchain you are using?
You can use footnote-mode [1] for easily producing the
footnotes/references if you're an emacs user.
Dominique
Footnotes:
[1] http://www.emacswiki.org/emacs/FootnoteMode
___
The grammar-combinators library is a parsing library employing a novel
grammar representation with explicit recursion. The library features
much of the power of a parser generator like Happy or ANTLR, but with
the library approach and most of the benefits of a parser combinator
library. Grammars an
Some snippets from the Tutorial [1] to give an idea of the
grammar-combinator library's approach, its functional style and its
additional power (e.g. the transformations used):
Defining a simple expresssions grammar:
grammarArith :: ExtendedContextFreeGrammar ArithDomain Char
grammarArith Line
Johannes,
(sorry for the double mail)
I will give some short answers below, but you can find more details in
the paper we are submitting to PADL 2011 [1].
2010/9/8 Johannes Waldmann :
>> .. grammar-combinator library's approach ..
> am I reading this correctly: in the traditional combinator appr
Johannes,
2010/9/8 Johannes Waldmann :
>
>> That compilation process is highly nonlocal
>> and would never be possible with, e.g., the Parsec approach.
>
> Pipe dream: attach such a grammar object to every Parsec parser,
> and include the "compiler" with the combinators,
> and have them run at (Ha
Paolo,
>> The problem with mult is that k is not specified unambiguously. You either
>> need v to determine k (which is probably not what you want, at a guess), mult
>> to take a dummy argument that determines what k is:
> [...]
>> or, to make Tensor a data family instead of a type family.
> What
> One question I have is whether I can eliminate points in the above
> definition of blowup, and write something like
>
>blowup = (++) . (blowup . allButLast, lastToTheLength)
>
> thinking of (++) as a function String x String -> String.
Actually (++) is of type String -> String -> String. Whe
Gregory,
2010/10/3 Gregory Crosswhite :
> On 10/3/10 1:45 PM, Dominique Devriese wrote:
>>
>> Additionally, you can't combine the functions (blowup . allButLast)
>> and lastToTheLength into a function that returns a pair like you seem
>> to attempt. You need a
2010/10/5 N. Raghavendra :
> At 2010-10-03T22:45:30+02:00, Dominique Devriese wrote:
>> comma :: (a -> b) -> (a -> c) -> a -> (b,c)
>> comma f g x = (f x, g x)
>>
>> comma = liftA2 (,)
>> blowup = (uncurry (++)) . liftA2 (,) (blowup . allButLas
Mauricio,
2010/10/6 Maurício CA :
> I've been working in a tool that reads a grammar with associated
> actions and act on input based on that grammar. I would like to
> rewrite it in a functional style, but I've not been able to find a
> theory that would handle any possible grammar with cyclicit
John, Oleg,
2010/10/9 :
>> So here's a very simple expression:
>>
>> t1 = let v = sigGen (cnst 1) in outs v v
>>
>> which is what led to my question. I'm binding the sigGen to 'v' to
>> introduce sharing at the meta-level. Would it be better to introduce
>> support for this in the dsl?
>
> Ofte
2010/10/12 :
>> An alternative approach to model sharing at the object level is the
>> technique I use for modelling context-free grammars in my PADL 2011
>> paper "Explicitly Recursive Grammar Combinators"... Using ideas from
>> the Multirec generic programming library and some recent Haskell ty
Romain,
2010/10/25 Romain Demeyer :
> I'm working on static verification in Haskell, and I search for existing
> works on specification of Haskell programs (such as pre/post conditions, for
> example) or any other functional language. It would be great if there exists
> a prover based on this kind
Hi all,
I have a problem with the design of the Applicative type class, and
I'm interested to know people's opinion about this.
Currently, the Functor and Applicative type class are defined like this:
class Functor f where
fmap:: (a -> b) -> f a -> f b
class Functor f => App
Yin,
2012/1/12 Yin Wang :
> I have an idea about type classes that I have been experimenting. It
> appears to be a generalization to Haskell’s type classes and seems to
> be doable. It seems to related the three ideas: type classes, implicit
> parameters, and (typed) dynamic scoping. But I don't k
Yin,
2012/1/14 Yin Wang :
> On Sat, Jan 14, 2012 at 2:38 PM, Dominique Devriese
> wrote:
>>> I may or may not have thought about it. Maybe you can give an example
>>> of parametric instances where there could be problems, so that I can
>>> figure out whether my s
2012/1/16 Yin Wang :
The typical example would be
instance Eq a => Eq [a] where
[] == [] = True
(a : as) == (b : bs) = a == b && as == bs
_ == _ = False
>>>
>>> It can handle this case, although it doesn't handle it as a parametric
>>> instance. I suspect that we do
David,
The easiest solution is probably to use multi-line string literals and
line-wrap manually:
\begin{code}
cyphertext = "rlkmlj, zlnift ekblvke pqc elvm if pzlp gblrk, akrlomk zk zle \
lfpiriglpke pzlp, if pzk flpojlb rcojmk cs knkfpm, morz qcobe ak pzk rcfeorp \
cs nkjriftkpcjiu, bklnkm
2012/6/27 Tillmann Rendel :
> MightyByte wrote:
>>
>> Of course every line of your program that uses a Foo will change if you
>> switch
>> to IO Foo instead.
>
>
> But we often have to also change lines that don't use Foo at all. For
> example, here is the type of binary trees of integers:
>
> dat
Hi,
2012/7/21 C Gosch :
> I am trying to use the TLS package from hackage, and it works fine so
> far -- except when a client wants to
> do session resumption (note I am not an expert in TLS, so it might be
> something quite simple).
> In that case, I get an alert, "unexpected message", during han
Patrick,
> -- Class with functional dependency
> class QUEUE_SPEC_CLASS2 a q | q -> a where
>newC2 :: q a -- ??
>sizeC2 :: q a -> Int
>restC2 :: q a -> Maybe (q a)
>insertC2 :: q a -> a -> q a
The above is a reasonable type class definition for what you seem to intend.
> -- Wit
Евгений,
> The possible extension may look somehow like this:
>
> class Applicative a => Branching a where
> branch :: a (Either b c) -> (a b -> a d) -> (a c -> a d) -> a d
What about the following alternative that does not require an extension?
import Control.Applicative
eitherA :: Applic
Andreas,
2012/11/1 Andreas Abel :
> Hello,
>
> maybe someone has experience in publishing papers that use lhs2TeX and
> unicode characters with ACM, and has been in my situation before...
>
> Sheridan, who publishes for ACM, does not like T3 fonts. However, lhs2tex
> --agda does make use of T3 fon
All,
Many (but not all) of the parsing algorithms that support left
recursion cannot be implemented in Haskell using the standard
representation of recursion in parser combinators. The problem
can be avoided in Scala because it has imperative features like
referential identity and/or mutable refe
2013/2/26 Martin Drautzburg :
> I wonder if I can enforce the nonNr property somehow, i.e. enforce the rule
> "will not consider the same nonterminal again without having consumed any
> input".
You might be interested in this paper:
Danielsson, Nils Anders. "Total parser combinators." ACM Sigpl
All,
2013/3/13 :
> So, Code is almost applicative. Almost -- because we only have a
> restricted pure:
> pureR :: Lift a => a -> Code a
> with a Lift constraint. Alas, this is not sufficient for realistic
> parsers, because often we have to lift functions, as in the example of
> parsing a
2013/3/13 Dominique Devriese :
> class ProductionRule p => LiftableProductionRule p where
> epsilonL :: a -> Q Exp -> p aSource
>
> and associated
> epsilonLS :: (Lift v, LiftableProductionRule p) => v -> p v
> epsilonLS v = epsilonL v $ lift v
Note that t
Hi all,
I often find myself needing the following definitions:
mapPair :: (a -> b) -> (c -> d) -> (a,c) -> (b,d)
mapPair f g (x,y) = (f x, g y)
mapFst :: (a -> b) -> (a,c) -> (b,c)
mapFst f = mapPair f id
mapSnd :: (b -> c) -> (a,b) -> (a,c)
mapSnd = mapPair id
But they seem missin
2013/5/28 Tikhon Jelvis :
> These are present in Control.Arrow as (***), first and second respectively.
Right, thanks. Strange that neither Hayoo nor Hoogle turned these up..
Dominique
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.h
All,
2010/12/27 Jonathan Geddes :
> I see TH used most for the following tasks:
>
> #1 Parse a string at compile-time so that a custom syntax for
> representing data can be used. At the extreme, this "data" might even
> be an EDSL.
> #2 Provide instances automatically.
Just a note that TH is also
Hi,
I'm also curious about this. Is a pure programming style like
Haskell's less or more natural than an imperative mutable-state based
one to kids without experience. I intuitively expect that for kids
with a high-school background in mathematics would find the first more
natural, but this is not
Also, is there any news yet on a procedure for community members with
accounts on projects.haskell.org to get access to them again? My ssh
publickey login is no longer being accepted. I had an account mainly
for hosting the darcs repo and the website for my project
grammar-combinators. The website
Kashyap,
2011/2/11 C K Kashyap :
> I've come across this a few times - "In Haskell, once can prove the
> correctness of the code" - Is this true?
> I know that static typing and strong typing of Haskell eliminate a whole
> class of problems - is that related to the proving correctness?
> Is it abo
2011/5/2 Ketil Malde :
> "There is a particular reason why monads had to arise in Haskell,
> though, which is to defeat the scourge of laziness."
>
> My own view is/was that monads were so successful in Haskell since it
> allowed writing flexible programs with imperative features, without
> sacr
2011/5/3 Manuel M T Chakravarty :
> Interestingly, today (at least the academic fraction of) the Haskell
> community appears to hold the purity of the language in higher
> regard than its laziness.
I find Greg Morissett's comment on Lennart Augustsson's article pro
lazy evaluation very interesting
Robert,
2011/5/16 Robert Clausecker :
> I found out, that GHC implements typeclasses as an extra argument, a
> record that stores all functions of the typeclass. So I was wondering,
> is there a way (apart from using newtype) to pass a custom record as the
> typeclass record, to modify the behavio
2011/6/9 Stephen Tetley :
> On 9 June 2011 09:02, Yves Parès wrote:
>> Were templates an original feature of C++ or did they appear in a revision
>> of the langage ?
>> Because C++ appeared in 1982 and Haskell in 1990.
>
> Templates were a later addition to C++. There is a strong tradition of
> ge
It's not the same as what you propose, but it's related, so for
discussion, I just want to point out idiom brackets (an analog for
do-notation for Applicative functors) which have been introduced in
some Haskell-related languages. Examples are Idris
(http://www.cs.st-andrews.ac.uk/~eb/Idris/donotat
All,
In case anyone is interested, I just want to point out an interesting
article about the relation between Haskell type classes and C++
(overloading + concepts):
http://sms.cs.chalmers.se/publications/papers/2008-WGP.pdf
Dominique
2011/10/3 Ketil Malde :
> sdiy...@sjtu.edu.cn writes:
>
>> T
41 matches
Mail list logo