So I have written some pretty elegant Haskell codes for my college homework and found out that they plan to support Haskell Not for our homework.
I have received an email saying that I should use most of the python from "functional" since all supported languages.
I have tried some quick codes to change the python, but it is a bit confused that in reality it is to look ugly.
Then my hazel code is
$ Code $ $ 5 input $
and my Python 3 code is
change = list (map (lambda x: list (map (lambda y: y.split (",", x)), map ( Lambda z: z.split ("- & gt;"), written_input [5:])))
Since I wrote about 10 lines of dragon, I was hoping for some That I am not getting a good way of handling such things.
The most disturbing fact of me is that sometimes I am X Split must be used and map should be map (F, X).
Is this a better way to approach?
I do not recommend typing the Python code in this way, because Python will list this type of thing It makes good use of understanding and other techniques, but if you really want to write it in functional style, it can do something like DTF (N, Iterated): return importer from imports from ISLICE (ITRAT, N) DEF software Import string from import string from
You can tell, this is quite dirty. Another dragon solution possibly
transition = (for a drop down (5, input) in B. a.split ('- & gt; ( This is also a case where I think regular expression is acceptable:< Code> Import on DEF split (* CEPS): return partial (re-split, '|'.) (Re-Asepep (sep) transition for sep in sep = IAP (split (',', '- & gt ; '), Drop (5, input))I am still using functional techniques, such as mapping, generic le / drop, partial application and understanding, but it comes out very cleaner to use more dragon features For the simplest case my favorite simple generator is understood, but the last one is very good if you want more delimiter.
No comments:
Post a Comment