News aggregator

What is haskell used for?

Haskell on Reddit - Mon, 11/02/2015 - 9:52am

What types of applications does haskell really excel at? What types of applications would really want to consider writing in haskell?

Whether it be speed, ease of use, maintainability, doesn't matter.

I am asking this because I am considering learning haskell and I would really like to know what its use cases are.

submitted by Korria_Kochello
[link] [19 comments]
Categories: Incoming News

Mark Jason Dominus: A message to the aliens, part 18/23 (cell respiration and division)

Planet Haskell - Mon, 11/02/2015 - 9:04am

Earlier articles: Introduction Common features Page 1 (numerals) Page 2 (arithmetic) Page 3 (exponents) Page 4 (algebra) Page 5 (geometry) Page 6 (chemistry) Page 7 (mass) Page 8 (time and space) Page 9 (physical units) Page 10 (temperature) Page 11 (solar system) Page 12 (Earth-Moon system) Page 13 (days, months, and years) Page 14 (terrain) Page 15 (human anatomy) Page 16 (vital statistics) Page 17 (DNA chemistry)

This is page 18 of the Cosmic Call message. An explanation follows.

The 10 digits are:


This page depicts the best way to fry eggs. The optimal fried egg is shown at left. Ha ha, just kidding. The left half of the page explains cellular respiration. The fried egg is actually a cell, with a DNA molecule in its nucleus. Will the aliens be familiar enough with the structure of DNA to recognize that the highly abbreviated picture of the DNA molecule is related to the nucleobases on the previous page? Perhaps, if their genetic biochemistry is similar to ours, but we really have no reason to think that it is.

The top formula says that C6H12O6 and O2 go in; the bottom formula says that CO2 comes out. (Energy comes out also; I wonder why this wasn't mentioned.) The notation for chemical compounds here is different from that used on page 14: there, O2 was written as ; here it is written as (“2×O”).

The glyph near the left margin does not appear elsewhere, but I think it is supposed to mean “cell”. Supposing that is correct, the text at the bottom says that the number of cells in a man or woman is . The number of cells in a human is not known, except very approximately, but is probably the right order of magnitude. (A 2013 paper from Annals of Human Biology estimates .)

Next to the cell is a ruler labeled meters, which is a typical size for a eukaryotic cell.

The illustration on the right of the page, annotated with the glyphs for the four nucleobases from the previous page , depicts the duplication of genetic material during cellular division. The DNA molecule splits down the middle like a zipper. The cell then constructs a new mate for each half of the zipper, and when it divides, each daughter cell gets one complete zipper.

The next article will discuss pages 19 and 20, shown at right. (Click to enlarge.) Try to figure it out before then.

Categories: Offsite Blogs

Should I use haskell at hackathons?

Haskell on Reddit - Mon, 11/02/2015 - 8:03am

Hi guys I've been interested in learning haskell for a while now. Recently I've started attending hackathons which are super fun, usually I make a web app using pythons flask and whatever restful apis the sponsors provide them regular html css and js for frontend.

Will learning haskell offer me anything new in terms of web app development. If not what kind of cool projects could I do with haskell in terms of hackathons/competitions?

submitted by BilboDankins
[link] [7 comments]
Categories: Incoming News

Derek Elkins: You know more about presheaves than you think

Planet Haskell - Mon, 11/02/2015 - 6:04am
The category of graphs as a presheaf

Here’s a small example of why people find category theory interesting. Consider the category, call it |ccC|, consisting of two objects, which we’ll imaginatively name |0| and |1|, and two non-identity arrows |s,t : 0 -> 1|. The category of graphs (specifically directed multigraphs with loops) is the category of presheaves over |ccC|, which is to say, it’s the category of contravariant functors from |ccC| to |cc"Set"|. I’ll spell out what that means momentarily, but first think about what has been done. We’ve provided a complete definition of not only graphs but the entire category of graphs and graph homomorphisms given you’re familiar with very basic category theory1. This is somewhat magical.

Spelling things out, |G| is a contravariant functor from |ccC| to |cc"Set"|. This means that |G| takes each object of |ccC| to a set, i.e. |G(0) = V| and |G(1) = E| for arbitrary sets |V| and |E|, but which will represent the vertices and edges of our graph. In addition, |G| takes the arrows in |ccC| to a (set) function, but, because it’s contravariant, it flips the arrows around. So we have, for example, |G(s) : G(1) -> G(0)| or |G(s) : E -> V|, and similarly for |t|. |G(s)| is a function that takes an edge and gives its source vertex, and |G(t)| gives the target. The arrows in the category of graphs are just natural transformations between the functors. In this case, that means if we have two graphs |G| and |H|, a graph homomorphism |f : G -> H| is a pair of functions |f_0 : G(0) -> H(0)| and |f_1 : G(1) -> H(1)| that satisfy |H(s) @ f_1 = f_0 @ G(s)| and |H(t) @ f_1 = f_0 @ G(t)|. With a bit of thought you can see that all this says is that we must map the source and target of an edge |e| to the source and target of the edge |f_1(e)|. You may also have noticed that any pair of sets and pair of functions between them is a graph. In other words, graphs are very simple things. This takes out a lot of the magic, though it is nice that we get the right notion of graph homomorphism for free. Let me turn the magic up to 11.

Presheaves are extremely important in category theory, so categorists know a lot about them. It turns out that they have a lot of structure (mostly because |cc"Set"| has a lot of structure). In particular, in the categorical jargon, if |ccC| is small (and finite is definitely small), then the category of presheaves over |ccC| is a complete and cocomplete elementary topos with a natural number object. For those of you learning category theory who’ve gotten beyond the basics, proving this is a very good and important exercise. In programmer-speak, that says we can do dependently typed lambda calculus with algebraic data and codata types in that category. To be clear, this is not saying we have a lambda calculus with a graph type. It’s saying we have a lambda calculus where all our types have graph structure.

Beyond graphs

But set that aside for now. This isn’t an article about graphs so let’s start generalizing away from them. We’ll start with a baby step. You can probably guess how we’d go about making edge labeled graphs. We’d add another object to |ccC|, say |2|, and an arrow from |2| to |1|, call it |l_e| — remember that the arrows are “backwards” because presheaves are contravariant. You may start seeing a pattern already. One way to start formalizing that pattern is to say for every object of |ccC| we have an abstract data type with a field for each arrow into that object. In our example, |1| has three arrows into it, namely |s|, |t|, and |l_e|. We can view an element |e in F(1)| for a presheaf |F| as having fields e.s, e.t and e.l_e. Since |cc"Set"| has (non-constructive, non-computable) decidable equality for everything, we can tell |e| from |e’| even if e.s = e'.s and e.t = e'.t and e.l_e = e'.l_e. This is different from a normal abstract data type (in a purely functional language) where an abstract data type with three fields would be isomorphic to a 3-tuple. The extra ability to differentiate them could be modeled by having a fourth field that returned something that could only be compared for equality, kind of like Data.Unique (ignoring the Ord instance…) It may look like:

data Vertex -- abstract vertexId :: Vertex -> Unique data Label -- abstract labelId :: Label -> Unique data Edge -- abstract edgeId :: Edge -> Unique src :: Edge -> Vertex tgt :: Edge -> Vertex label :: Edge -> Label

Of course, if these are literally all the functions we have for these types (plus some constants otherwise we can’t make anything), then these abstract types might as well be records. Anything else they have is unobservable and thus superfluous.

data Vertex = Vertex { vertexId :: Unique } data EdgeLabel = EdgeLabel { edgeLabelId :: Unique } data Edge = Edge { edgeId :: Unique, src :: Vertex, tgt :: Vertex, edgeLabel :: EdgeLabel }

This starts to suggest that we can just turn each object in our category |ccC| into a record with an ID field. Each arrow in to that object becomes an additional field. This almost works. We’ll come back to this, but let’s take another baby step.

Something a bit more interesting happens if we want to label the vertices. We proceed as before: add another object, call it |3|, and another arrow |l_v : 3 -> 0|. This time, though, we’re not finished. |ccC| is supposed to be a category, so we can compose arrows and thus we have two composites but no arrow for the composites to be, namely: |s @ l_v| and |t @ l_v|. The abstract data type intuition suggests that whenever we run into this situation, we should add a distinct arrow for each composite. For the purpose of labeling vertices, this is the right way to go: we want to think of each vertex as having a vertex label field with no constraints. There is, however, another choice. We could add one new arrow and have both composites be equal to it. What that would say is that for every edge, the source and the target vertices must have the same label. It’s easy to see that that would lead to every vertex in a connected component having the same label. In code, the former choice would look like:

data VertexLabel = VertexLabel { vertexLabelId :: Unique } data Vertex = Vertex { vertexId :: Unique, vertexLabel :: VertexLabel } data EdgeLabel = EdgeLabel { edgeLabelId :: Unique } data Edge = Edge { edgeId :: Unique, src :: Vertex, tgt :: Vertex, edgeLabel :: EdgeLabel -- With our earlier "rule" to add a field for each arrow -- we should also have: -- srcVertexLabel :: VertexLabel -- tgtVertexLabel :: VertexLabel -- but, by definition, these are: -- vertexLabel . src and -- vertexLabel . tgt respectively. -- So we don't explicitly add a field for composite arrows. }

The latter choice would look the same, except there would be an extra constraint that we can’t capture in Haskell, namely vertexLabel . src == vertexLabel . tgt.

If we stick to the abstract data type intuition and we have a cycle in the arrows in |ccC|, then the requirement to add a distinct arrow for each composite means we need to add a countably infinite number of arrows, so |ccC| is no longer finite. It is still “small” though, so that’s no problem. We could say we have a finite graph of the non-composite arrows and possibly some equations like |s @ l_v = t @ l_v| and we generate a category from that graph subject to those equations by adding in all composites as necessary. We will use the arrows in this graph to decide on the fields for our abstract data types, rather than the arrows in the category so we don’t end up with an infinity of fields in our data types. Even when there aren’t an infinite number of arrows in our category, this is still useful since we aren’t going to add a field to our edges to hold each vertex’s label, since we can just get the vertex and then get the label.

Some of you have probably thought of another more appropriate intuition. A presheaf is a database. The category which our presheaf is over, what we’ve been calling |ccC| 2 is sort of like a schema. You don’t specify types, but you do specify foreign key relationships plus some additional integrity constraints that don’t fit in to the typical ones supported by databases.

Presheaves as databases

For our earlier example:

CREATE VertexLabel (Id uniqueidentifier PRIMARY KEY); CREATE Vertex ( Id uniqueidentifier PRIMARY KEY, Label uniqueidentifier REFERENCES VertexLabel(Id) ); CREATE EdgeLabel (Id uniqueidentifier PRIMARY KEY); CREATE Edge ( Id uniqueidentifier PRIMARY KEY, Src uniqueidentifier REFERENCES VertexLabel(Id), Tgt uniqueidentifier REFERENCES VertexLabel(Id), Label uniqueidentifier REFERENCES EdgeLabel(Id) -- Nothing stops us from having additional columns here and elsewhere -- corresponding to the fact that our types were really abstract data -- types in the Haskell, and to the fact that we can choose an arbitrary -- set as long as it has at least this much structure. They won't be -- preserved by "homomorphisms" though. );

To be clear, each presheaf corresponds to a database with data. Inserting a row into a table is a homomorphism of presheaves, but so is adding a (not preserved by homomorphism) column. The schema above corresponds to the |ccC| part of the presheaf.

If we had made that second choice before where we had only one arrow back that would lead to the following integrity constraint:

NOT EXISTS(SELECT * FROM Edge e JOIN Vertex src ON e.Src = src.Id JOIN Vertex tgt ON e.Tgt = tgt.Id WHERE src.Label <> tgt.Label)

It turns out this intuition is completely general. You can actually think of all of presheaf theory as a (slightly unusual) database theory. More objects just means more tables. More arrows means more foreign keys and potentially additional integrity constraints. It’s not exactly relational though. In fact, in some ways it’s a bit closer to SQL3 or object databases. You can turn this around too going back to the point at the beginning. Whether or not we can think of all presheaves like databases or all databases like presheaves, we can certainly think of this example, and many like it, as presheaves. This means for many “databases”, we can talk about doing dependently typed programming where our types are databases of the given shape. This also dramatically shifts the focus in database theory from databases to database migrations, i.e. homomorphisms of databases.

David Spivak is the one who has done the most on this, so I’ll refer you to his work. He also has a better story for schemas that are much closer to normal schemas. I’ll end as I began:

Here’s a small example of why people find category theory interesting.

  1. “very basic category theory” means knowing the definitions of categories, isomorphisms, functors, and natural transformations

  2. remember the presheaf is the functor from |ccC^(op) -> cc“Set”|

  3. SQL is hardly the relational ideal

Categories: Offsite Blogs

Blow my mind, in one line.

Haskell on Reddit - Mon, 11/02/2015 - 5:12am

Of course, it's more fun if someone who reads it learns something useful from it too!

submitted by octatoan
[link] [216 comments]
Categories: Incoming News

Haskell job market?

Haskell on Reddit - Mon, 11/02/2015 - 3:50am

I'm in an interesting position now (by interesting I mean uncomfortable!). I am currently unemployed and looking for work. My background is in mass spectrometry/chemistry (to PhD level) and I have been learning programming this year. The first language I studied was Python and I did get paid to do some programming in Python with my former employer (who has now retired). More recently, I have been studying Haskell and I have found that I love the language and want to use it more in the future. I applied for post-doctoral position recently and had hopes on doing a lot of programming for data analysis and use the position to develop what I have learnt in the last year or so. However, I just found out today that I did not get the position since I do not have a background in the analysis of proteins by mass spectrometry (my background is mainly in lipid analysis).

Anyway, I was wonder what the Haskell job market is like for those who aren't experts in the language? What are the chances of finding an employer that is willing to develop the skills of someone who is passionate about programming and is willing to work hard to learn what is required? Personally, I would be willing to work at a lower wage initially to develop my skills since I see my future in programming (for more work available for those with the skills!). I just have to make it through this rough transitional period.

submitted by MyFunc
[link] [19 comments]
Categories: Incoming News

FP Lunch: How to Distribute a Study Report

Planet Haskell - Mon, 11/02/2015 - 3:25am

Your pit bull could be the lighting of one’s life, but you will need the correct reports when you wish his renowned background to be appreciated by others. His lineage is traced by a pitbull’s forms and present how superior his breeding in fact is. Then there is no solution to get paperwork, in the event one’s pitbull werent’s parents registered. A pitbull with paperwork could be able to contend in puppy exhibits, and his pups can demand a greater value from owners that are prospective. Recommendations Examine the paperwork whenever you ordered your pitbull that you obtained. You could possess a Puppy Registration App from the Kennel Club and should have a subscription certificate. Contact your breeder in the event you didn’t get paperwork.

Error you cannot process articles longer than 5,000 words.

Ask for a registration certificate. Request if your pet is not ineligible for the American Kennel Team based on his reputation. If he is, request an Registration Program. Enroll your dog using the American Kennel Team utilizing the documents you received from your own breeder. You are able to do this online at with the AKC site,, and clicking on “Subscription.” Input information regarding yourself and your dog to get him documented and acquire paperwork. A charge is for joining your dog. Enroll your pet with other teams for additional paperwork. Corporations like the American Pitbull Registry and the United Club can register your dog and provide you with paperwork demonstrating that enrollment.

Categories: Offsite Blogs

Brent Yorgey: ICFP roundup

Planet Haskell - Sun, 11/01/2015 - 8:47pm

Well, ICFP 2015 in Vancouver is already two months in the past… I’ve been meaning for a while to write a post reflecting on the experience. Better late than never!

The Place

I had never been to Vancouver before; it seems like a beautiful and fun city. One afternoon I skipped all the talks and went for a long hike—I ended up walking around the entire perimeter of the Stanley Park seawall, which was gorgeous. The banquet was at the (really cool) aquarium—definitely the first time I have eaten dinner while being watched by an octopus.

The People

Instead of staying in the conference hotel, four of us (me, Ryan Yates, Ryan Trinkle, and Michael Sloan) rented an apartment through AirBnB.1 The apartment was really great, it ended up being cheaper per person than sharing two hotel rooms, and it was a lot of fun to have a comfortable place to hang out in the evenings—where we could sit around in our pajamas, and talk, or write code, or whatever, without having to be “on”.

I met some new people, including Aahlad Gogineni from Tufts (along with another Tufts student whose name I unfortunately forget); Zac Slade and Boyd Smith from my new home state of Arkansas; and some folks from Vancouver whose names I am also blanking on at the moment. I also met a few people in person for the first time I had previously only communicated with electronically, like Rein Heinrich and Chris Smith.

I also saw lots of old friends—way too many to list. It once again reminded me how thankful I am to be part of such a great community. Of course, the community is also far from perfect; towards that end I really enjoyed and appreciated the ally skills tutorial taught by Valerie Aurora (which probably deserves its own post).

The Content

Here are just a few of my favorite talks:

I had a lot of great discussions relating to diagrams. For example:

  • I talked with Alan Zimmerman about using his and Matthew Pickering’s great work on ghc-exactprint with an eye towards shipping future diagrams releases along with an automated refactoring tool for updating users’ diagrams code.

  • After talking a bit with Michael Sloan I got a much better sense for the ways stack can support our development and CI testing process.

  • I had a lot of fun talking with Ryan Yates about various things, including projecting diagrams from 3D into 2D, and reworking the semantics and API for diagrams’ paths and trails to be more elegant and consistent. We gave a presentation at FARM which seemed to be well-received.

I got another peek at how well Idris is coming along, including a few personal demonstrations from David Christiansen (thanks David!). I am quite impressed, and plan to look into using it during the last few weeks of my functional programming course this spring (in the past I have used Agda).

If I had written this as soon as I got back, I probably could have remembered a lot more; oh well. All in all, a wonderful week, and I’m looking forward to Japan next year!

  1. Yes, I know that hotel bookings help pay for the conference, and I admit to feeling somewhat conflicted about this.

  2. I asked him afterwards how he made the great animations in his slides, and sadly it seems he tediously constructed them using PowerPoint. Someday, it will be possible to do this with diagrams!

Categories: Offsite Blogs

3D programming in Haskell: Extensive GPipe tutorial now availible

Haskell on Reddit - Sun, 11/01/2015 - 10:38am

I have just published the last part of a comprehensive tutorial for GPipe 2:

Please make sure you use GPipe version 2.1.3 or later if you want to try the examples yourself.

Edit: I wish I had written "available" in the title. I didn't. I wrote "availible".

submitted by tobbebex
[link] [13 comments]
Categories: Incoming News

Month in Haskell Mode October 2015

haskell-cafe - Sun, 11/01/2015 - 10:06am
Welcome Haskell Mode users, Haskell Mode progress report for October 2015. It is also available online <> and on reddit <> . For previous issue see September 2015 <> . <>What is Haskell Mode? Haskell Mode is an umbrella project for multiple Emacs tools for efficient Haskell development. Haskell Mode is an open source project developed by a group of volunteers. For more information see <>Important developments Functionality provided by haskell-indentation received a lot of fixes and contributions lifting it to a complete new le
Categories: Offsite Discussion

FP Lunch: Scholarships with February 2015 deadlines

Planet Haskell - Sun, 11/01/2015 - 9:09am

Buying a vehicle from a private retailer who still owes cash about the car can be complex. Owner won’t manage to exchange the title of the vehicle for you before loan is paid down. Before the mortgage is paid down, a lien may stick to the car, and as a shopper, you may not wish to be held responsible for that mortgage along with everything you pay for the car. You are able to make sure that you will not find yourself using an unforeseen fiscal pressure, by using certain precautions. Ad Measures Part 1 of 2: If Income Is Owed Discovering Talk with the DMV. Should you live in the United States, you’re able to verify the reputation of a caris lien by visiting a state’s DMV website. You’ll have to know the vehicle’s produce, design, and vehicle identification number (VIN), that may all be on the vehicleis registration paperwork. Generally an inquiry can follow exactly the same procedure, although approach may vary somewhat by condition. The DMV will have the ability to inform you the final day that a concept was processed because express, how many liens (if any) occur to the vehicle, along with the title and tackle of each mortgage holder.

Figure out how to deliver and demand cash.

Give your contact information inside the online type through the DMV’s website. Fill out all of the vital information for the DMV to recognize the car. This can usually include the produce, design of the automobile, in addition to the VIN. Save the shape using Adobe. Connect in an email and send it for the email listed about the DMV site. Advertising Search on the internet. Several sites, including Carfax and, let you search for mortgage information, utilizing the VIN and also the make and style of the vehicle.

And tea tree gas has agents in-it which might be drying agents.

Many of these websites are free, while a payment charges. Talk with the Private Property Securities Register. Some places have a government-manage Individual Home Investments Register, or possibly a similar registry in position, in which safety interests held in private property (in this instance, vehicles) are cataloged online and may be sought out by interested parties. You can search online to learn if the car you are buying has money owed about it if you live-in a location that’s such a registry. Consumers in Australia and New Zealand may go to and click “research.” Customers may also have search engine results texted to your cellular phone for a $3 service fee. Work an HPI Check. HPI Inspections could inform potential buyers perhaps the car is compromised or has improved distance, along with in case a car has excellent fund owed about it.

So that the left edge sets contrary to the report manual heap the paper.

HPI Inspections are blame, but can offer peace of mind in regards to purchasing a used-vehicle. Ask to view document or the concept of registration. In a few places, a car seller must exhibit a replica of the state document of enrollment, which may only be had if there are no debts owed around the automobile to audience. In other countries, the autois title may echo the bank has liens on the car, suggesting that the supplier has outstanding loans having a standard bank. Advertising Part 2 of 2: Obtaining The Debt Settled Consult the vendor to cover. If you’re thinking about buying a car or truck with funds you may want to demand that the seller takes care of his debt before you supply him any money. You might want to claim that owner take an individual mortgage out to protect the expenses, before you get it as a way to secure the concept. Should you insist the seller takes care of his loans before you buy the automobile, be sure you get a signed, written proof of payment from capital company or the selleris lender. If you can, accompany the seller to standard bank or the lender so that you can supervise the method and realize for certain that the automobile’s loans have already been settled in full.

Since it moves to another from era, training is just the heart of a community.

If those possibilities are available where you will purchase the vehicle you might want to run another search through PPSR or HPI if you fail to get anything written down from the bank confirming the loans were compensated entirely. This can permit you to validate that the loans have now been satisfied. Renegotiate the purchase price. If you’re still considering buying the vehicle, make an effort to renegotiate the purchase price you’d pay for the retailer, after factoring in just how much he nevertheless owes around the vehicleis loans. Deduct the amount that the supplier owes for the bank in the price you originally assumed was a reasonable income cost for that car. Supply to cover the seller that quantity, after you’ve paid the rest of owneris loan towards lender that has a mortgage about the automobile or the bank. Possess the owner send you an old commission quote.

Understand somebody you rely register your manager that is investigate.

Once you have paid the mortgage, and presented the seller any leftover money after agreeing over a price, you may have the concept used in your title. Set up. If you worry about owner not holding his end-of the settlement to pay his auto loans off, you are able to always put up an escrow account. Your money would be held by this for a predetermined period of time, during which the vendor must pay-off his loans and exchange you the title to be able to get your money. Within the United States, the Department of Motor Vehicles advises using Escrow. Set a merchant account up at. Produce a deal, and also have the seller consent to conditions and the terms. Deposit your cash. Until the loans have already been settled PaySAFE will not release the amount of money to the supplier and the title is ready to change hands.

You have to grieve these overlooked requirements and to know and confirm what happened.

Ask a seller to agent the selling. By finding a dealership included, you make certain that title is legitimate and that you will have a document trail that proves all obligations were manufactured. You may have to pay more, since the dealer will want to make a gain buying the auto from the supplier and in convert promoting you it, but you’ll have peaceofmind with your purchase. Anticipate this to be a costlier alternative, while the seller will want to produce some cash from your sale. You could ask the vendor so you don’t wind up paying out more for the vehicle to cover the vendor out of her or his earnings. Ad We could truly utilize your support! Can you inform US about Locks? Yes No Can you reveal about Pokemon? Yes No Can you inform US about Cold candy?

Do not only quit at building a checklist while producing the proposal.

Yes No Can you tell us about Taking care of legs? Yes No For aiding cheers! Please reveal everything you find out about… Tell us whatever you know below. Remember detail is much better. Ideas Present specifics. Please be detailed as you can in your reason. We revise it for accuracy and understanding will get your comprehensive data, and incorporate it into articles that will assist a large number of people. Do not state: Eat fats.

This will assist us acknowledge and take care of several types of problems.

Do claim: Incorporate fats with a few vitamins and minerals to the ingredients you previously eat. Attempt butter, olive oil, grape. Ideas Contemplate obtaining legitimate help in this subject. After you pay owner, you want to make sure you own the car clear and free of any lender mortgage. Legal counselor or legal counsel can help you ensure you are secured. Alerts Be sure in case you pick that option, to make use of a reliable escrow service. Look for a lender or additional brokerage who seasoned and is qualified.

Categories: Offsite Blogs

Updating polymorphic records

Haskell on Reddit - Sun, 11/01/2015 - 8:44am

I'm working on a project which makes use of polymorphic records and I ran into this error message today while trying to update a field using record update syntax: Record update for insufficiently polymorphic field. What is the best way around this? I manually wrote a function updateMyField :: MyRecord -> MyFieldValue -> MyRecord where I just fill in all the fields manually and it works fine, which kind of makes me wonder exactly what record update syntax is even doing.

In any case, I don't like this fix because I have to manually write such a function for each polymorphic field in my record, which seems quite silly. What's the best way around this? Should I just abandon record update syntax entirely and generate lens bindings instead? Or will they also be confused by this?

submitted by dnkndnts
[link] [16 comments]
Categories: Incoming News