evilsoft / crocks

A collection of well known Algebraic Data Types for your utter enjoyment.
https://crocks.dev
ISC License
1.59k stars 102 forks source link

TS typings #286

Open tonisostrat opened 6 years ago

tonisostrat commented 6 years ago

Have you planned or thought about creating typings files to support us TS developers?

jakubbarczyk commented 4 years ago

@dalefrancis88 I do remember that point. It is actually ill-advised to maintain type definitions within a library that is written in plain JavaScript. When it comes to using TypeScript, remember the "no free lunch" principle. Employing TS in a project introduces a significant overhead when developers spend time creating and maintaining relevant types. I have experienced that over the years.

jakubbarczyk commented 4 years ago

@bennypowers thanks! Merged.

pyrho commented 4 years ago

can I be of any help @jakubbarczyk ? Like add missing types (if so which ones would you like me to help with)? In any case, thanks a lot (for the typings and this cool lib).

jakubbarczyk commented 4 years ago

Hey @pyrho, thanks for reaching out. I went through all the crocks typings and it seems that the following items still require attention:

Looking at @bennypowers' contribution, there might be a need to refactor the existing definitions to use the declare keyword and move them from barrels (index.d.ts) to dedicated files.

FYI @dalefrancis88

area73 commented 4 years ago

Hi @jakubbarczyk , I'm learning crocks as a side project and I will like to use types, I show your fork on DefinitelyTyped and this thread , and I was wondering if you accept PR on your branch to help you on types definitions. I see that @pyrho is also helping and I don't want to step into his work or working in something that is already assigned or done

jakubbarczyk commented 4 years ago

Sure, I welcome any help @area73. My previous comment still holds. Thanks!

bennypowers commented 4 years ago

It's worth noting that TS 4's variadic tuples will make capturing compose and curry possible in their type system

jakubbarczyk commented 4 years ago

I've been quite busy lately, but I'm picking up the pace. I should be able to finalize the typings by the end of next week. Please, consider joining Crocks' gitter channel.

kierans commented 3 years ago

@jakubbarczyk Thanks for the work that you and others have done on this. I've taken a look at your DefinitelyTyped fork, and I'm wondering where the progress of this issue lies as it would be great to get the types published.

kierans commented 3 years ago

@kompedia At least if the PR gets raised then I can bug them 😆

jakubbarczyk commented 3 years ago

@kierans Thanks! I planned to create a PR some time ago. Due to "the bug" I had to postpone. Let me see about that this weekend. Will keep you posted. DT owners' review might take a while too, mind you.

@kompedia At least if the PR gets raised then I can bug them 😆

jakubbarczyk commented 2 years ago

To all it may concern: @types/crocks Now that the initial release is out, I would very much want to make Crocks typings more sophisticated.

JacopKane commented 2 years ago

To all it may concern: @types/crocks Now that the initial release is out, I would very much want to make Crocks typings more sophisticated. wow looking forward to trying this soon!

davidnussio commented 5 months ago

In my opinion, the most promising TypeScript functional programming ecosystem to use today could be Effect

kierans commented 5 months ago

Without starting a fight (because we programmers love our wars <cough>tabs</cough>) I’ve personally found TS (and most statically typed languages) to be too cumbersome to do elegant FP in. I’ve also found type definitions in code largely unnecessary as if my signatures are getting too unwieldy it’s a sign I’m to doing too much in that function and I need to break it apart.

Consider the elegance of String -> String -> Object vs (a: String): (b: String) => Record<any, any>. Given I tend to orientate more towards pointfree programming I might implement that signature with a combinator (eg: converge). Whereas in TS I find the compiler tends to choke sometimes if I don’t declare variables properly leading to verbose syntax

I’ve been working on a TS codebase professionally for about a year now and it’s a mixture of pseudo FP (in that I compose functions and use concepts like currying in places but not pure functions as we don’t use monads to isolate effects, etc) and OOP. TS works great for OOP, but I just find it inelegant for FP.

I do like Crocks however 😆