Re: [Haskell-cafe] Plain lambda inside banana brackets in the arrow notation

2012-07-15 Thread Ertugrul Söylemez
Ross Paterson wrote: > Though one possibility that might get us most of the way there would > be to refactor the Arrow class as > > class PreArrow a where > premap :: (b -> b') -> a b' c -> a b c Note that you are reinventing the 'profunctors' package here. Every arrow forms a profunctor

Re: [Haskell-cafe] Interest in typed relational algebra library?

2012-07-07 Thread Ertugrul Söylemez
Paul Visschers wrote: > I've been out of the Haskell game for a bit, but now I'm back. A > couple of years ago I made a small library that implements relational > algebra with types so that malformed queries and other operations are > caught at compile time. It is heavily based off of the interna

Re: [Haskell-cafe] Plain lambda inside banana brackets in the arrow notation

2012-07-06 Thread Ertugrul Söylemez
Tsuyoshi Ito wrote: > How can I use combinators like repeat, which takes a plain function as > an argument, in the arrow notation in a more readable way? Or am I > trying to do an impossible thing? To answer your question: Arrow notation has no support for what you want, so if you stick with i

Re: [Haskell-cafe] How do people still not understand what FP is about? What are we doing wrong?

2012-06-18 Thread Ertugrul Söylemez
Christopher Done wrote: > > You just have to live with the fact that there will always be a > > small percentage of retarded people.  It's best to just ignore them. > > Well, they're not stupid. Just very stubborn. Like most programmers. > Stupid people can be taught to be smarter, stubborn peopl

Re: [Haskell-cafe] How do people still not understand what FP is about? What are we doing wrong?

2012-06-18 Thread Ertugrul Söylemez
Ben Kolera wrote: > "Programming languages that require random senseless voodoo to get an > effect are awesome. Let's make programming hard through poor design." > [1] > > [...] > > Is it even worth trying to convince people so set in their ways? Someone saying something as stupid as this probab

Re: [Haskell-cafe] lightweight alternative to mtl?

2012-06-16 Thread Ertugrul Söylemez
Anton Kholomiov wrote: > What are you using instead of mtl? I need simple type for State. The > more classy it gets the harder error messages are to understand. I've > installed new package. Silently it installed new mtl. And here I'm > staring into three lines of code for half an hour trying

Re: [Haskell-cafe] Program for displaying graph state in lambda interpreter?

2012-06-02 Thread Ertugrul Söylemez
Benjamin Redelings wrote: > However, it would be nice to know of any programs that are better > suited for this. For example, if I could write <>*<> and draw arrows > from the placeholders "<>" to the memory location being referenced, > that would be easier to read. This is done here > htt

Re: [Haskell-cafe] Confused by ghci output

2012-05-31 Thread Ertugrul Söylemez
Clark Gaebel wrote: > *X> 3^40 `mod` 3 == modexp2 3 40 3 > False > *X> modexp2 3 40 3 > 0 > *X> 3^40 `mod` 3 > 0 > > I'm confused. Last I checked, 0 == 0. This has to do with types: > 3^40 `mod` 3 0 > 3^40 `mod` 3 :: Int 2 When doing number theory always use Integer. Greets,

Re: [Haskell-cafe] gona to join in haskell-cafe

2012-05-26 Thread Ertugrul Söylemez
"Dante.py" wrote: > I come from China, wishing to enjoy haskell with you. Hi there and welcome to the Haskell community. =) Greets, Ertugrul signature.asc Description: PGP signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http:/

Re: [Haskell-cafe] Formalisation for types of monads

2012-05-23 Thread Ertugrul Söylemez
Yves Parès wrote: > > Note about []: Don't even mention foldl. The folding > > combinator for lists is foldr, period. > > Yes, I do agree. I came to this when I realized foldr gave the church > encoding of a list. Not only that. The foldr combinator has an identity fold and implements act

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-21 Thread Ertugrul Söylemez
Ryan Newton wrote: > I do think we have the opposite problem, however, in much Haskell code > -- people are using the clean, obviously correct, but inefficient code > even in standard library functions that really should be optimized > like crazy! Not necessarily. For example the 'nub' function

Re: [Haskell-cafe] Formalisation for types of monads

2012-05-21 Thread Ertugrul Söylemez
Yves Parès wrote: > When explaining monads to beginners (having an imperative background), > I found myself to say that there is *roughly* three "groups" of monads > (because they're always worried about their cost, i.e. their > incidental complexity): My recommendation (as I've taught Haskell t

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-18 Thread Ertugrul Söylemez
wren ng thornton wrote: > However, while the "logical" interpretation of Ertugrul's words may be > that simple-mindedness implies performance-desire, that interpretation > is not the only one available to the standard interpretation of his > words, nor IMO the dominant interpretation. It is equal

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-14 Thread Ertugrul Söylemez
Dmitry Vyal wrote: > > My point is: If you need C-like performance at a certain spot there > > is really no excuse for writing the entire application in C. > > Haskell has a working, powerful enough FFI. Also idiomatic Haskell > > code nowadays performs close to C. If your code doesn't, chances a

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-12 Thread Ertugrul Söylemez
Gregg Lebovitz wrote: > Ryan writes: > > With a few years of Haskell experience in my backpack I know how to > utilize laziness to get amazing performance for code that most people > would feel must be written with destructively updating loop. That was me actually. Just a minor side note that s

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-10 Thread Ertugrul Söylemez
Ryan Newton wrote: > I think this is a bit of an unfair accusation ("simple-minded"). > Performance is only relevant to certain domains, sure. But program > performance is an entire *industry*. And I'd argue it's of massive > importance to the world at large. Intel has an army of "AE"s > (app

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-06 Thread Ertugrul Söylemez
Roman Cheplyaka wrote: > > isn't it that particular Haskell code is outperforming C (22 > > seconds vs. 33), just because the author uses recursion in C? I > > surely love Haskell, and the way it's code is easy parallelized, but > > that example seams not fair. > > I think the point was to take

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-06 Thread Ertugrul Söylemez
"Janek S." wrote: > a couple of times I've encountered a statement that Haskell programs > can have performance comparable to programs in C/C++. I've even read > that thanks to functional nature of Haskell, compiler can reason and > make guarantess about the code and use that knowledge to automat

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-03 Thread Ertugrul Söylemez
Thomas DuBuisson wrote: > Vincent has done great work for Haskell+Crypto so I think he knows I > mean nothing personal when I say cprng-aes has the right idea done the > wrong way. Why a new effort vs Vincent's package? > > 1. cprng-aes is painfully slow. > 2. It doesn't use NI instructions (or

Re: [Haskell-cafe] Annoyed at System.Random

2012-05-03 Thread Ertugrul Söylemez
Thomas DuBuisson wrote: > I've grown annoyed at System.Random enough (specifically, StdGen). > How much, if any, pushback would there be if I put together a FFI > binding to a C AES-CTR based RNG. There are many advantages: > > [...] > > I'd be tempted to pull in the 'entropy' package for seedin

Re: [Haskell-cafe] I Need a Better Functional Language!

2012-04-10 Thread Ertugrul Söylemez
Tillmann Rendel wrote: > > I am curious what are interesting use-cases for that? Symbolic > > analysis? self-compilers? > > Optimization. For example, imagine the following definition of > function composition: > >map f . map g = map (f . g) >f . g = \x -> f (g x) > > In Haskell, we canno

Re: [Haskell-cafe] Is this a correct explanation of FRP?

2012-04-01 Thread Ertugrul Söylemez
Peter Minten wrote: > Sorry, I don't understand this. Would it be correct to say that AFRP > shares the basic ideas of FRP in that it has behaviors and > events/signals and that the main difference comes from the way AFRP is > implemented? Well, FRP is usually interpreted as dealing with time-va

Re: [Haskell-cafe] Is this a correct explanation of FRP?

2012-03-29 Thread Ertugrul Söylemez
Peter Minten wrote: > I've been trying to get my head around Functional Reactive Programming > by writing a basic explanation of it, following the logic that > explaining something is the best way to understand it. > > Am I on the right track with this explanation? You are explaining a particula

Re: [Haskell-cafe] is the evaluation order deterministic when using applicative with IO

2012-03-16 Thread Ertugrul Söylemez
Rouan van Dalen wrote: > I was wondering if I can make assumptions about the evaluation order > of the following code: Nitpick: This is execution order, not evaluation order. The evaluation order is indeed undefined here. Greets, Ertugrul -- nightmare = unsafePerformIO (getWrongWife >>= se

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Ertugrul Söylemez
Hi there, Christopher Svanefalk wrote: > there is a question I have been thinking about a bit. In short, we > could simply formulate it like this: > > Are there any problems which *cannot *be solved a side effect-free > language (such as Haskell)? In other words, are there problems that > would

Re: [Haskell-cafe] Haskell showcase in 5 minutes

2012-02-28 Thread Ertugrul Söylemez
Arnaud Bailly wrote: > Thanks Yves for your advice. And I agree with you that too much > laziness may be mind-blowing for most of the audience, yet this is one > of the characteristics of Haskell, whether or not we like it and > whatever troubles it can induce. > > I really think the knapsack is

Re: [Haskell-cafe] Haskell showcase in 5 minutes

2012-02-27 Thread Ertugrul Söylemez
Arnaud Bailly wrote: > I will be (re)presenting Haskell in a "Batlle Language" event > Wednesday evening: A fun and interactive contest where various > programming language champions try to attract as much followers as > possible in 5 minutes. > > Having successfully experimented the power of liv

Re: [Haskell-cafe] "Best" FRP package for newbie

2012-02-17 Thread Ertugrul Söylemez
"Gabríel A. Pétursson" wrote: > Netwire by Ertugrul Söylemez would be a good library to start with. > If for some reason netwire doesn't quite suit your needs, take a look > at Animas, a fork of Yampa. > > http://hackage.haskell.org/package/netwire-3.1.0 > h

Re: [Haskell-cafe] Mersenne-random and standard random API

2012-02-09 Thread Ertugrul Söylemez
Yves Parès wrote: > I've been in the past told that mersenne-random was much better than > the standard random package. This is relative. The Mersenne Twister algorithm has a large memory footprint, but in relation to the size of the average Haskell program, this is probably not much of an issu

Re: [Haskell-cafe] Conduit experiment: Is this correct?

2012-02-03 Thread Ertugrul Söylemez
Michael Snoyman wrote: > In this particular case, it will work due to the implementation of > snk. In general, however, you're correct: you should not use the same > sink twice. > > I haven't thought about it much yet, but my initial recommendation > would be to create a new Conduit using Sequenc

Re: [Haskell-cafe] Conduit experiment: Is this correct?

2012-02-03 Thread Ertugrul Söylemez
Michael Snoyman wrote: > In this particular case, it will work due to the implementation of > snk. In general, however, you're correct: you should not use the same > sink twice. > > I haven't thought about it much yet, but my initial recommendation > would be to create a new Conduit using Sequenc

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-03 Thread Ertugrul Söylemez
Steve Horne wrote: > There's a proposal at the moment to add support for TDNR to Haskell - > to leverage "the power of the dot" (e.g. for intellisense). > > http://hackage.haskell.org/trac/haskell-prime/wiki/TypeDirectedNameResolution I'm not sure whether this should really be a language feature

[Haskell-cafe] Conduit experiment: Is this correct?

2012-02-03 Thread Ertugrul Söylemez
Hello there, I'm trying to build a server for testing the conduit and network-conduit packages. As a contrived example the goal is to pick the first three lines from the client and send them back without the line feeds. After that, I'd like to switch to a simple echo server. This is the code:

Re: [Haskell-cafe] network-conduit failing to close sockets

2012-02-01 Thread Ertugrul Söylemez
Michael Snoyman wrote: > Good catch, thanks guys. New version released. > > Note: there was the same bug in runTCPClient, the new test suite > checks for both. Thanks for the quick response. Greets, Ertugrul -- Key-ID: E5DD8D11 "Ertugrul Soeylemez " FPrint: BD28 3E3F BE63 BADD 4157 9134 D56

[Haskell-cafe] network-conduit failing to close sockets

2012-02-01 Thread Ertugrul Söylemez
Hello there, I have tried to implement a simple echo server using the network-conduit library version 0.2.1. This is the code: module Main where import Data.Conduit import Data.Conduit.Network main :: IO () main = runTCPServer (ServerSettings 4000 Nothing) ($$) It works, b

Re: [Haskell-cafe] strict version of Haskell - does it exist?

2012-01-30 Thread Ertugrul Söylemez
Alexander Bernauer wrote: > On Sun, Jan 29, 2012 at 11:25:09PM +0100, Ertugrul Söylemez wrote: > > First of all, /learning/ to optimize Haskell can be difficult. The > > optimizing itself is actually fairly easy in my experience, once you > > understand how the language

Re: [Haskell-cafe] strict version of Haskell - does it exist?

2012-01-29 Thread Ertugrul Söylemez
Marc Weber wrote: > A lot of work has been gone into GHC and its libraries. > However for some use cases C is still preferred, for obvious speed > reasons - because optimizing an Haskell application can take much > time. > > Is there any document describing why there is no ghc --strict flag > mak

Re: [Haskell-cafe] Serializing UTCTimes

2012-01-20 Thread Ertugrul Söylemez
Bas van Dijk wrote: > However I have no idea how to serialize the DiffTime stored in an > UTCTime: > > instance Serialize DiffTime where > get = ? > put = ? Note that DiffTime has this weird property that there is a Real instance, so you have a toRational function. ;) To go the other wa

Re: [Haskell-cafe] On the purity of Haskell

2012-01-01 Thread Ertugrul Söylemez
Steve Horne wrote: > The do-notation sugar may confuse the issue - the <- looks like an > operator, but translating to binds-and-lambdas form suggests > otherwise. Quick translations (I hope no mistakes) with lots of > parens... > >m >>= (\x -> (f x x)) > >m >>= (\x -> (m >>= (\y -> (f x

[Haskell-cafe] Thanks and a happy new year!

2012-01-01 Thread Ertugrul Söylemez
Dear fellow Haskellers, as I have learned so much throughout the past four years of Haskell experience, I feel obligated to thank everyone for the nice support and the great ideas. Exploring and using Haskell has changed my way of thinking about programming and computers in a profound way and mad

Re: [Haskell-cafe] Are all monads functions?

2011-12-31 Thread Ertugrul Söylemez
Yves Parès wrote: > But still, I maintain my previous view. I could clarify that by saying > that (e.g. for Maybe) we could separate it in two types, Maybe itself > and its monad: > > -- The plain Maybe type > data Maybe a = Just a | Nothing > > -- The MaybeMonad > newtype MaybeMonad a = MM ( ()

Re: [Haskell-cafe] State Machine Composition

2011-12-22 Thread Ertugrul Söylemez
Daniel Waterworth wrote: > I made this simple state machine combinator library today. I think it > works as a simple example of a good use for GADTs. > > https://gist.github.com/1507107 Aren't your examples all special cases of the generic automaton arrow? There are two ways to represent it, bot

[Haskell-cafe] Test

2011-12-21 Thread Ertugrul Söylemez
This is a test. Please disregard. -- nightmare = unsafePerformIO (getWrongWife >>= sex) http://ertes.de/ signature.asc Description: PGP signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-c

[Haskell-cafe] AFRP is not (necessarily) imperative

2011-12-12 Thread Ertugrul Söylemez
Hello fellows, after a few discussions on IRC and via private mail I feel obligated to point out that arrows and in particular AFRP do not force you to use an imperative style in any way. You can use a style very similar to SHE's idiom brackets. I will demonstrate this using the Netwire library.

[Haskell-cafe] web-routes-quasi: Generating a route type

2011-12-09 Thread Ertugrul Söylemez
Hello there, I'm trying to use the web-routes-quasi package outside of Yesod. Is there any documentation on how to use TH to generate a route type just like Yesod does? Or is that a Yesod-specific feature? I don't need the actual automatic dispatch or anything, just a type to work with. If it'

Re: [Haskell-cafe] How did iteratees get their names?

2011-12-07 Thread Ertugrul Söylemez
Henrik Nilsson wrote: > > Just like chatter and chattee, employer and employee, there is an > > iterator (usually as part of an enumerator/ee) and an iteratee. > > Thanks for the attempt to explain. But I, at least, remain mystified, > and I agree with Douglas that the terminology is confusing. >

Re: [Haskell-cafe] How did iteratees get their names?

2011-12-07 Thread Ertugrul Söylemez
Douglas McClean wrote: > I love iteratees as a paradigm for IO, but I am having trouble > developing a relationship with the names. Could someone explain their > origin? > > It seems like if iteratees consume things, enumerators produce them, > andenumeratees do both that names like Sink, Source,

Re: [Haskell-cafe] ANNOUNCE: monad-control-0.3

2011-12-03 Thread Ertugrul Söylemez
Bas van Dijk wrote: > It provides lifted versions of functions from the base library. > Currently it exports the following modules: > > * Control.Exception.Lifted > * Control.Concurrent.Lifted > * Control.Concurrent.MVar.Lifted > * System.Timeout.Lifted > > These are just modules which people hav

[Haskell-cafe] Ann: Netwire 3.0.0

2011-12-01 Thread Ertugrul Söylemez
Hello there, Netwire 3.0.0 is out: Overview Netwire is a library for high performance functional reactive programming, which calls its signal functions 'wires'. It solves the classic problems of FRP through a number of simple concepts:

<    1   2