![]() I have no doubt that this Haskell code can be improved (probably dramatically, lol), especially the way I handle a new Customer, but as mentioned, it represents what I know today. Please bear in mind that I’m not a Haskell expert, so I have no idea if any of that code represents Haskell best practices or worst practices. It does take some configuration, and Eclipse requires some learning (I have a tutorial for it too), but StatET has always impressed me as very well-designed. TODO add breadsticks, soft drinks, etc.ĭata Order = Order ) = If you do want to use an IDE for R, and want something different, I’ve always admired (from afar) StatET, for which there is a nice introduction in progress. So, without further ado, here is some sample source code that represents what I know about Haskell so far: Example Haskell source code (pizza order entry system) The other 50% is in a module that defines what a Pizza is, and also defines its helper functions. I need to re-organize the code, but this is what about 50% of the code looks like right now. It has a command-line UI that prompts the user to add Pizzas and a Customer to an Order. I’m currently trying to cram Haskell into my brain, and in an effort to do so, I’ve been writing a fake POS (point of sales) application.
0 Comments
Leave a Reply. |