-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prepare for 1.0: big cleanup/simplification #84
Comments
|
About
so I'd rather keep
|
What about labels for most functions? I have standardized to doing this on most of my stuff and I find it helps in reading/understanding the code. Also, if backwards breaking, what about getting rid of that hideous |
@orbitz that's an option, indeed. Do you use |
Looks like this is going to be a bit more breaking than originally anticipated, anyway, even if only because of |
@orbitz I'm also considering having |
I'm pro-labels as the first-class style. I just think the readability win is super high. A stdlib style For folds, it seems like Once you decide what style you'd like, give me some modules and I can offer my slave labour to mechanically convert them. |
Good, I think I will do it then. Only some already existing functions will have an unlabelled version (so that |
It's also the right moment to ask for direly missing features in core modules (e.g. |
By that do you mean you will do |
Yes, something like that (or |
My vote is to not do that and just to have the function everyone expects to exist to be labeled. It just seems like weird complexity to add if you're willing to break backwards compatibility here. I'd rather have |
Well, people also expect |
In that case, I feel like |
I was surprised by how trivial it is to add a Labels module -- simply create the mli file and include the original module, and the functions get translated automatically. Since it's so easy, I don't see a down side with providing alternative label and non-label versions. |
I strongly dislike those |
I've never really used them either... I kind of like letting people choose, but I can see Jane Street's view that it's just sowing confusion. I dunno -- feel free to decide on a path forward. In an alternate universe, I'm enjoying using the one-and-only OCaml stdlib and focusing on more productive things. |
another vote: for keeping the most basic reduction functions unlabeled. i already find
to be sufficiently verbose, adding labels are useful for 1. not having to remember argument order 2. readability of code where the fact that an argument is a function is not obvious 3. switching argument order for currying. in my experience all these are not common problems for the most basic reduction functions like map, fold -- of course for specialized, rarely used functions this is different. so requiring labels for the more basic functions is only motivated by consistency. so if a more-or-less clear cut can be made between 'workhorse' and 'rare' functions, i would vote for labeling only the rare ones. |
I generally agree that map shouldn't require ~f, but already with fold_left and fold_right you want ~init or ~zero to indicate which is the accumulator (since they have different argument orders for some reason). And if you start with the folds, the odd one out becomes map... argh. If OCaml had haskell's \ instead of fun, I would feel better about using a few more keystrokes per function. |
for the folds i always thought the order is because it's the same order in which you give arguments to |
Well in my experience it's on |
The fact that OCaml makes it trivial to make a labeled version of a non-labeled implementation really makes it tempting IMO. |
I think labels would be pretty nice to have and I would sometimes use them but I would also prefer having separate modules for the labeled interfaces rather than having some parts labeled and other parts not labeled. |
I'm for having a labeled version of the apis, even if its main benefit is to make it easier to swap between jane street's core (or base?) and containers. Sometimes I am forced to switch from one to the other and the most common hangup is the labeled argument function. |
You're not making my life easy, the choice is going to be tough :p |
Ok, I think I will just add |
Feature wish for 1.0: Rewrite
|
|
I'm not sure why you don't like it, it's essential, and it's not a problem if you have good combinators (like Also, Please add |
I meant |
Preparing version 1.0, with some breaking changes. The goal of this release is not to add significant new features, but to improve consistency and focus on the core features and modules (in particular, droping or reducing the scope of some of the experimental modules).
The working branch is prepare-1.0 .
NOTE: please ask if you want something changed/added to the list!
Todo list
~or_
by~default
)iter'
,map'
, …) forCCList
and the others?of_list
#85)int_
,bool_
, etc. inCCOrd
CCIO.File.walk
work properly with symlinks, even broken[ ] addCCIO.File.is_symlink
[ ] addCCIO.File.deref : ?recursive:bool -> string -> string
[ ] makeCCIO.File.walk_item = [
Dir |File |
Symlink] (breaking compat)Lexing
(seenunchaku
)bitfield
(much simpler version, almost functor-free,Bit_set
)CCFormat
(see improveCCFormat
#82)CCFormat.of_to_string : ('a -> string) -> 'a t
CCFormat.const : 'a t -> 'a -> unit t
(to hide the type'a
)CCFormat.text
to mimickFormat.pp_print_text
CCFormat.return : (unit,…) format4 -> unit
(for strings without arguments)CCFormat.some : 'a t -> 'a option t
(prints nothing ifNone
, same as arg ifSome x
)start/stop
arguments?sep
a argument-free formatter, default",@ "
, usingFormat.fprint out "%(%)" sep
to print it in combinators
OR use
unit t
withreturn: arg-free formatter -> unit t
andsp = return ",@ "
or sthCCOrd.Infix
CCPrint
(just use format)pp
as pretty-printer everywhere, and removeBuffer.t
printerscontainers.advanced
(refer toolinq
)Array1
(point to oml or similar instead)CCBigstring
(point tobigstring
library instead)CCUnix
adding simple functions such as(alreadypopen
with_process_*
)threads
library and make it into its own repo/package (if anyone uses it — need more tests)CCList.Set
CCList.Idx
[ ] flattenCCList.Assoc
CCList.Zipper
into its own module (in containers.data)CCList.Ref
? can keep it, probablyCCArray.Sub
into its own module (in containers.data), add many tests[ ] moveCCString.Sub
into its own module (in containers.data)containers.string
, merging useful functionality intoCCString
edit_distance
toCCString
, fromCCLevenshtein
[ ] add submoduleEdit_distance_automaton
(with compiled automaton + index, maybe)CCKMP
, makeCCString.Find
public (provides same functionality)App_parse
CCParse
intocore
oasis-parser
forCCParse
(string input only!) + update testsresult
everwhere, drop the polymorphic variants that remainCCError
in favor ofCCResult
Hashtbl.seeded_hash
for implementing better hash combinators inCCHash
(from smbc)CCGraph
(functor designed for local def?)before pre-release:
[ ] remove all@since
annotationsocp-indent
The text was updated successfully, but these errors were encountered: