Re: lodash like utility/algorithms library for D

2018-10-01 Thread aliak via Digitalmars-d-announce
On Monday, 1 October 2018 at 00:51:24 UTC, Paul Backus wrote: On Sunday, 30 September 2018 at 22:17:05 UTC, aliak wrote: On Saturday, 29 September 2018 at 19:27:29 UTC, Paul Backus wrote: I agree that this is useful, but why not just return a naked `SumType!(string, JSONError)` in that case? Is

Re: lodash like utility/algorithms library for D

2018-09-30 Thread Paul Backus via Digitalmars-d-announce
On Sunday, 30 September 2018 at 22:17:05 UTC, aliak wrote: On Saturday, 29 September 2018 at 19:27:29 UTC, Paul Backus wrote: I agree that this is useful, but why not just return a naked `SumType!(string, JSONError)` in that case? Is there some additional value added by the `Expect` wrapper tha

Re: lodash like utility/algorithms library for D

2018-09-30 Thread aliak via Digitalmars-d-announce
On Saturday, 29 September 2018 at 19:27:29 UTC, Paul Backus wrote: On Saturday, 29 September 2018 at 12:40:14 UTC, aliak wrote: I.e. by allowing you to define the unexepcted you could for instance: enum JSONError { invalidKey, notString, notNumber } auto a = parse(jsonData); a.getAsString(

Re: lodash like utility/algorithms library for D

2018-09-29 Thread Paul Backus via Digitalmars-d-announce
On Saturday, 29 September 2018 at 12:40:14 UTC, aliak wrote: I.e. by allowing you to define the unexepcted you could for instance: enum JSONError { invalidKey, notString, notNumber } auto a = parse(jsonData); a.getAsString("key").match!( (string value) => // yay (JSONError error) =>

Re: lodash like utility/algorithms library for D

2018-09-29 Thread aliak via Digitalmars-d-announce
On Saturday, 29 September 2018 at 12:44:38 UTC, aliak wrote: On Saturday, 29 September 2018 at 01:40:34 UTC, Robby Marki wrote: On Friday, 28 September 2018 at 14:02:48 UTC, aliak wrote: [...] In this example https://aliak00.github.io/ddash/ddash/functional/try_.html where does the match fun

Re: lodash like utility/algorithms library for D

2018-09-29 Thread aliak via Digitalmars-d-announce
On Saturday, 29 September 2018 at 01:40:34 UTC, Robby Marki wrote: On Friday, 28 September 2018 at 14:02:48 UTC, aliak wrote: Hi, I've been working for fun on a library [0] that is inspired by a library from the javascript world called lodash [1]. I basically liked the flexibility and thought

Re: lodash like utility/algorithms library for D

2018-09-29 Thread aliak via Digitalmars-d-announce
On Friday, 28 September 2018 at 17:33:04 UTC, Paul Backus wrote: On Friday, 28 September 2018 at 14:02:48 UTC, aliak wrote: Hi, [...] Lots of good stuff here! I'm curious about your approach to `Expect`, since I've written a version of it myself. How useful have you found being able to use

Re: lodash like utility/algorithms library for D

2018-09-28 Thread Robby Marki via Digitalmars-d-announce
On Friday, 28 September 2018 at 14:02:48 UTC, aliak wrote: Hi, I've been working for fun on a library [0] that is inspired by a library from the javascript world called lodash [1]. I basically liked the flexibility and thought I'd try and implement a few things as it was about the time I star

Re: lodash like utility/algorithms library for D

2018-09-28 Thread Paul Backus via Digitalmars-d-announce
On Friday, 28 September 2018 at 14:02:48 UTC, aliak wrote: Hi, [...] Lots of good stuff here! I'm curious about your approach to `Expect`, since I've written a version of it myself. How useful have you found being able to use unexpected values of any type, as opposed to just exceptions?

Re: lodash like utility/algorithms library for D

2018-09-28 Thread aliak via Digitalmars-d-announce
On Friday, 28 September 2018 at 14:02:48 UTC, aliak wrote: Hi, [...] PS Docs: https://aliak00.github.io/ddash/ddash/algorithm.html

lodash like utility/algorithms library for D

2018-09-28 Thread aliak via Digitalmars-d-announce
Hi, I've been working for fun on a library [0] that is inspired by a library from the javascript world called lodash [1]. I basically liked the flexibility and thought I'd try and implement a few things as it was about the time I started learning D. It basically tried to do the same with algo