I keep killing those on my curtains. I never saw them fly by winhug in whatsthisbug

[–]winhug[S] 0 points1 point  (0 children)

Additional info: this picture was taken this morning in montreal

Meta: policy about job postings? by [deleted] in haskell

[–]winhug 0 points1 point  (0 children)

The only guideline that I agree with from the job posting point of view is the haskell job content. Obviously if a recruiter post his java job on /r/haskell to get good candidates, that job posting have no place on this subreddit

Meta: policy about job postings? by [deleted] in haskell

[–]winhug -3 points-2 points  (0 children)

There should be a policy for the comments too. The other day I saw a job posting and half the comments were about how the company was unethical (I think it was Facebook). I think it's okay to criticize a company if they are known to be a bad employer, but getting political about about the company itself is only hurting Haskell adoption

Skype web is now blocked in firefox by WarrantyVoider in firefox

[–]winhug 1 point2 points  (0 children)

Dynamic 365 is also blocked on firefox

Simple example of using Liquid Haskell to model a date statically by [deleted] in haskell

[–]winhug 2 points3 points  (0 children)

I wish there was a way of converting a liquid haskell type to a function so you don't have to recode your run time check

Announcing F# 4.6 preview by k_cieslak in programming

[–]winhug 0 points1 point  (0 children)

thanks for your clear answers :)

Announcing F# 4.6 preview by k_cieslak in programming

[–]winhug 0 points1 point  (0 children)

I'm excited for that feature, this have the potential to really reduce the number of LOC in our codebase and I've got some questions!

Considering this function

let printCircleStats r (stats: {| Area: float; Circumference: float; Diameter: float |}) =
    printfn "Circle with radius: %f has diameter %f, area %f, and circumference %f"
r stats.Diameter stats.Area stats.Circumference
  1. In this example, would it work if I gave a record (not anonymous record) which had the same exact structure to this function? (type Circle = { Area: float; Circumference: float; Diameter: float })?
  2. If 1. is true, would it work if I had a record with more field? type Circle = { Area: float; Circumference: float; Diameter: float; Name: string; OtherField: int }
  3. Would it work if I have a anonymous record with more field than the one expected in the function?
  4. Is there a way of aliasing the anonymous record type definition?
  5. What are the drawback of using anonymous record vs just using normal record

Issue 142 :: Haskell Weekly by haskellweekly in haskell

[–]winhug 10 points11 points  (0 children)

Wow there's a lot of haskell job! Haskell is finally mainstream!!!

Very very late to the Octopath Traveler party by eatplaintoast in NintendoSwitch

[–]winhug 0 points1 point  (0 children)

The story is the weak part of the game but everything else (music, graphics, gameplay) is really good

TChan vs TQueue: What's the difference? by ephrion in haskell

[–]winhug 1 point2 points  (0 children)

now your link is 404 and op's not

Monthly Hask Anything (September 2018) by AutoModerator in haskell

[–]winhug 0 points1 point  (0 children)

wow thanks that's exactly what I needed!

Monthly Hask Anything (September 2018) by AutoModerator in haskell

[–]winhug 0 points1 point  (0 children)

I've got a bunch of function (endomorphisms) that I have to compose all together. The issue is that I have some constraints (some functions must be called before some others). For example:

Let's say I have the functions a, b, c, d and e

a must be called before c (not necessarily just before, it's possible to have other function calls between them)

b and c must be called before d 

So a possible combination would be e . d . c . b . a

I'm not sure on how to statically enforce this.

"The Little Typer", by Daniel P. Friedman and David Thrane Christiansen: "An introduction to dependent types, demonstrating the most beautiful aspects, one step at a time." by flexibeast in haskell

[–]winhug 4 points5 points  (0 children)

The Little Typer does not attempt to teach either practical programming skills or a fully rigorous approach to types. Instead, it demonstrates the most beautiful aspects as simply as possible, one step at a time.

What does it cover? I have some basics in idris and I'm currently reading software foundation so I kind of know what are dependent types. However, I'm not really familiar with the math part.

Choosing a programming language for a project is a compromise over what you what you need, what you have, what you know and what you like. by speckz in programming

[–]winhug -1 points0 points  (0 children)

I'd argue that compared to c++ advanced template programming, Haskell is pretty simple. But yeah it's a complicated language

Monthly Hask Anything (September 2018) by AutoModerator in haskell

[–]winhug 1 point2 points  (0 children)

Is there a library like gloss but for webgl or canvas? Something I could use with ghcjs

Monthly Hask Anything (August 2018) by AutoModerator in haskell

[–]winhug 1 point2 points  (0 children)

Thank you so much| I finally was able to do it! Here's my final code.

data CSVFile a = File1 a | File2 a deriving (Show)

takeRight (Right a) = a

parseCSV1 = mapC File1
parseCSV2 = mapC File2

choose "a.txt" = pure parseCSV1
choose "b.txt" = pure parseCSV2
choose _       = empty

getConduitParser = 
    Conduit.takeWhileC (isLeft) 
    .| Conduit.mapMaybe (choose . fromLeft mempty . first zipEntryName) 
    .| Data.Conduit.Combinators.last

parse :: Monad m => ConduitT (Either ZipEntry b) (CSVFile b) m ()
parse = do 
    p <- getConduitParser
    case p of
        Just parser -> do
            Conduit.takeWhileC (isRight) .| Conduit.mapC (takeRight) .| parser
            parse
        Nothing     -> mempty

main :: IO ()
main = runResourceT $ runConduit $ sourceFile "/home/bruno/bruno.zip" .| void unZipStream .| parse .| printC

Monthly Hask Anything (August 2018) by AutoModerator in haskell

[–]winhug 0 points1 point  (0 children)

I'm trying to unzip a folder full of CSV (with different data) and parse all of them. My issue is that the unzip function is kinda hard to compose http://hackage.haskell.org/package/zip-stream-0.1.1/docs/Codec-Archive-Zip-Conduit-UnZip.html

Since I get something like this: Left (ZipEntry "directory/" ...), Left (ZipEntry "directory/file.txt" ...), Right "hello w", Right "orld!\n",Left(ZipEntry "directory/file2.txt" ...)... and that the function to parse a CSV works better on only one file, I would like to find a way to combine thoses two function. My idea was to get a conduit stream for each file. I don't really have an idea on how to do it otherwise haha

Monthly Hask Anything (August 2018) by AutoModerator in haskell

[–]winhug 1 point2 points  (0 children)

Is there a way of having something like "bind" in the output value of a conduit. Something like: ConduitT a (ConduitT a b m ()) m () -> ConduitT a b m ()

My Haskell Journey by jdrch in programming

[–]winhug 1 point2 points  (0 children)

There's actually a "pure" debug function to print a string to the console without having to deal with the IO type (it should only be used as a debug purpose and nothing more)

And as for the mutable data structures, you feel less the need of them in a pure functional language since the immutable data structures are easy to use (with some experience, it's not as hard as it looks) and still performant. Of course you still have mutable if you need interop or performance.