[Haskell-cafe] DIY vs as-a-Service with MemCachier

2013-01-16 Thread 山本和彦
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 _

[Haskell-cafe] ANN: hoodle-0.1.1

2013-01-16 Thread Ian-Woo Kim
Hi, hoodle lovers :-) I am pleased to announce hoodle v0.1.1. In this version, I added the following functionality and made several improvement. * context (popup) menu support : after you select, you will see a context menu for the selected items (make pdf, make svg, cut, copy, delete ...) You

Re: [Haskell-cafe] 9.3 - (2 * 4.5) => 0.3000000000000007

2013-01-16 Thread Joe Q
Welcome to IEEE floating point math! Wikipedia has a good article on the specification. If you want exact fractional numbers for your own purposes, there are a number of ways around the limits of floats. Rational will represent numbers internally as fractions, and still allow you to use the same

Re: [Haskell-cafe] 9.3 - (2 * 4.5) => 0.3000000000000007

2013-01-16 Thread Albert Y. C. Lai
On 13-01-16 10:04 AM, Luis Cabellos wrote: You should read http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.22.6768 If you want to be efficient with floats. Language independent. And also http://floating-point-gui.de/ ___ Haskell-Cafe mailing

Re: [Haskell-cafe] 9.3 - (2 * 4.5) => 0.3000000000000007

2013-01-16 Thread David Turner
On 16/01/2013 13:55, Tom Davie wrote: Prelude> import Data.Ratio Prelude Data.Ratio> 93 % 10 - (2 * 9 % 2) 3 % 10 Or even just a type annotation: Prelude> (9.3 - (2 * 4.5)) :: Rational 3 % 10 On 16 Jan 2013, at 13:25, ivan dragolov mailto:i...@dragolov.net>> wrote: 9.3 - (2 * 4.5) => 0.30

Re: [Haskell-cafe] Type hierarchy

2013-01-16 Thread Kim-Ee Yeoh
On Wed, Jan 16, 2013 at 11:22 PM, Thiago Negri wrote: > The C spec allows the use of GLboolean values where GLenums are expected. > Some fixes off the top of my head (caveats apply): * define a lift :: GLboolean -> GLenum * use a typeclass GLenumlike * if there aren't too many of them, roll a G

Re: [Haskell-cafe] Type hierarchy

2013-01-16 Thread Thiago Negri
Thanks for the answer, but I'm trying to avoid type classes. By the way, I'm not trying to embed OO into Haskell. I'm trying to solve this issue: https://github.com/haskell-opengl/OpenGLRaw/issues/15 The binding to OpenGL declares GLenum as CUInt and GLboolean as CUChar, meaning I can't use a GLe

Re: [Haskell-cafe] Type hierarchy

2013-01-16 Thread Felipe Almeida Lessa
For your particular constraints, it can be as easy as: class IsA a where toA :: a -> A foo' :: IsA a => a -> C foo' = foo . toA However, you may asking the wrong question since it smells like you're trying to embed OO into Haskell =). Cheers, On Wed, Jan 16, 2013 at 1:03 PM, Thiago N

Re: [Haskell-cafe] 9.3 - (2 * 4.5) => 0.3000000000000007

2013-01-16 Thread Daniel Fischer
On Wednesday 16 January 2013, 15:25:15, ivan dragolov wrote: > 9.3 - (2 * 4.5) => 0.3007 > > I expected 0.3 > > ? Prelude Text.FShow.RealFloat> FD 9.3 9.300710542735760100185871124267578125 The closest Double to 9.3 is somewhat larger than 9.3. Since the first two signi

[Haskell-cafe] Type hierarchy

2013-01-16 Thread Thiago Negri
Hello. How do I achieve type hierarchy in Haskell? Suppose we have the following code: foo :: A -> C bar :: B -> C I want something that allow me to say that B is a subtype of A, meaning: 1. I can use a value of type A where a value of type A is needed. 2. I can use a value of type B where a va

Re: [Haskell-cafe] 9.3 - (2 * 4.5) => 0.3000000000000007

2013-01-16 Thread Luis Cabellos
You should read http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.22.6768 If you want to be efficient with floats. Language independent. Luis On Wed, Jan 16, 2013 at 2:25 PM, ivan dragolov wrote: > > 9.3 - (2 * 4.5) => 0.3007 > > I expected 0.3 > > ? > > -- > Иван Драголов >

Re: [Haskell-cafe] 9.3 - (2 * 4.5) => 0.3000000000000007

2013-01-16 Thread Tom Davie
Prelude> import Data.Ratio Prelude Data.Ratio> 93 % 10 - (2 * 9 % 2) 3 % 10 Floating point sucks, avoid it if you can. Thanks Tom Davie On 16 Jan 2013, at 13:25, ivan dragolov wrote: > > 9.3 - (2 * 4.5) => 0.3007 > > I expected 0.3 > > ? > > -- > Иван Драголов > dragolov.net

Re: [Haskell-cafe] 9.3 - (2 * 4.5) => 0.3000000000000007

2013-01-16 Thread Patrick Mylund Nielsen
This may be of interest if you want full-precision decimals: http://www.haskell.org/haskellwiki/Libraries_and_tools/Mathematics#Decimal_numbers On Wed, Jan 16, 2013 at 7:30 AM, Patrick Mylund Nielsen < hask...@patrickmylund.com> wrote: > Fun with floating point! > > # ghci > GHCi, version 7.4.2:

Re: [Haskell-cafe] 9.3 - (2 * 4.5) => 0.3000000000000007

2013-01-16 Thread Austin Seipp
This is a rounding error. It will happen in any language due to the imprecision of floats; for example, using Ruby: $ irb 1.9.3-p286 :001 > 9.3 - (2 * 4.5) => 0.3007 1.9.3-p286 :001 > ^D $ Read this: http://floating-point-gui.de/ On Wed, Jan 16, 2013 at 7:25 AM, ivan dragolov wrot

Re: [Haskell-cafe] 9.3 - (2 * 4.5) => 0.3000000000000007

2013-01-16 Thread Patrick Mylund Nielsen
Fun with floating point! # ghci GHCi, version 7.4.2: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> 9223372036854775807.0 == 9223372036854775808 True http

[Haskell-cafe] 9.3 - (2 * 4.5) => 0.3000000000000007

2013-01-16 Thread ivan dragolov
9.3 - (2 * 4.5) => 0.3007 I expected 0.3 ? -- Иван Драголов dragolov.net GSM: 0888 63 19 46 GSM за SMS: 0878 82 83 93 facebook.com/ivan.dragolov twitter.com/dragolov ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskel

[Haskell-cafe] ANN: Hakyll 4

2013-01-16 Thread Jasper Van der Jeugt
After a few weeks of beta status [1], I've now released version 4.0 of the Hakyll static site generator library. I'm really glad with this release, as from what I've found and heard, it makes many things a lot easier. # Main changes - The important `Compiler` type has been changed from `Arrow` to

[Haskell-cafe] PhD studentships in Nottingham

2013-01-16 Thread Graham Hutton
Dear all, The School of Computer Science in Nottingham is advertising a number of PhD studentships. Applicants in the area of the Functional Programming Lab (fp.cs.nott.ac.uk) would be very welcome. If you are interested in applying, please contact a potential academic supervisor in the FP lab p

Re: [Haskell-cafe] How to disable document in .cabal file?

2013-01-16 Thread Magicloud Magiclouds
That is pretty much the way I do now. Just curious if there is another way On Wed, Jan 16, 2013 at 3:57 PM, Erik Hesselink wrote: > You could do what I do: create an alias in bash. I have in my ~/.bashrc: > > alias ciq='cabal install --disable-documentation > --disable-library-profiling --d

Re: [Haskell-cafe] How to disable document in .cabal file?

2013-01-16 Thread Magicloud Magiclouds
Never noticed copy command. Let me see On Wed, Jan 16, 2013 at 1:51 PM, Albert Y. C. Lai wrote: > On 13-01-15 09:10 PM, Magicloud Magiclouds wrote: > >> So the only way is to use param every time I build this certain project? >> Really hoping I could disable it in project.cabal >> > >

Re: [Haskell-cafe] How to disable document in .cabal file?

2013-01-16 Thread Erik Hesselink
You could do what I do: create an alias in bash. I have in my ~/.bashrc: alias ciq='cabal install --disable-documentation --disable-library-profiling --disable-executable-profiling' The alias 'ciq' stands for 'cabal install quick' and disables things I don't need during development, but do slow d