My experience so far #318
Replies: 2 comments 5 replies
-
One more thing I realize stood out to me: Tuple types only work for pairs. I was able to do (Tuple a (Tuple b c)) before reverting to a named type constructor. Just curious if this is by design. I think the word 'tuple' indicates that it could be n-elements, where Pair might indicate 2 elements. |
Beta Was this translation helpful? Give feedback.
-
This looks like a bug caused by the coalton error message failing to format but I can't reproduce locally. I think it might be caused by some difference in the way You can get this by running
which should print something like |
Beta Was this translation helpful? Give feedback.
-
Overall I think it's been a good experience. I'm working through an idea I had for an OOP system within the FP paradigm. It's not quite there yet, but I'll definitely share it when I have something ready.
I will bring up a few issues I had and some things that I liked.
It'd be great if there were type aliases: like Haskell's
type
keyword. These wouldn't define a new type or data constructors, but just be different names for existing types. This is probably the number one thing I want most.I would hope for a relevant error when I accidentally name a variable the same as a type constructor, but I got something like:
error in FORMAT: Unknown format directive (character: Return)
Pattern variable ~/coalton-impl::sexp-fmt/ matches name of known ~
constructor. If you meant to match against the constructor then ~
use ~/coalton-impl::sexp-fmt/ instead.
[Condition of type SB-FORMAT:FORMAT-ERROR]
Once I figured out what ^^ actually means it was no problem, but I think more relevant error messages is a VERY close 2nd for thing I want most.
I actually frequently want to name the value the same as its constructor -- but all lowercase. I think I was under the impression that Coalton was case-sensitive (based on the naming conventions in the examples). but I don't think it is. I'll probably adopt some kind of type-name convention so I don't pollute my variable & function namespace.
I encountered some package locks when I was first setting up my package that uses Coalton, and it wasn't able to define-instance eq.
Just to verify my package looks like:
Are there more packages I can easily just USE?
In order to get better error messages I break up all of my top level forms into (coalton-toplevel ...), this is because SBCL is able to give SLIME the source info. Is there a way to have a "coalton" file where they are all automagically put into coalton-toplevel forms?
I like the error messages I get when there is a type mismatch. They are very helpful.
I feel good about the syntax for the most part.
It's kinda interesting to look at the macro-expansions for the code. I think it generates pretty reasonable code.
Beta Was this translation helpful? Give feedback.
All reactions