c355e3b has quit [Quit: Connection closed for inactivity]
jemc has joined #ponylang
mrkishi has quit [Ping timeout: 246 seconds]
jemc has quit [Ping timeout: 272 seconds]
jemc has joined #ponylang
jemc has quit [Ping timeout: 244 seconds]
bb010g has joined #ponylang
amclain has quit [Quit: Leaving]
Perelandric has quit [Ping timeout: 250 seconds]
SilverKey has joined #ponylang
srenatus has joined #ponylang
SilverKey has quit [Quit: Halted.]
jemc has joined #ponylang
mrkishi has joined #ponylang
jemc has quit [Ping timeout: 244 seconds]
copy` has quit [Quit: Connection closed for inactivity]
mrkishi has quit [Ping timeout: 264 seconds]
tm-exa has joined #ponylang
tm-exa has quit [Client Quit]
tm-exa has joined #ponylang
bb010g has quit [Quit: Connection closed for inactivity]
hibnico has joined #ponylang
Applejack_ has joined #ponylang
Applejack_ has quit [Ping timeout: 246 seconds]
hibnico has quit [Quit: hibnico]
Praetonus has joined #ponylang
Applejack_ has joined #ponylang
hibnico has joined #ponylang
trapped has joined #ponylang
trapped has quit [Read error: Connection reset by peer]
trapped has joined #ponylang
c355e3b has joined #ponylang
Praetonus has quit [Remote host closed the connection]
Perelandric has joined #ponylang
Praetonus has joined #ponylang
SilverKey has joined #ponylang
SilverKey has quit [Read error: Connection reset by peer]
SilverKey has joined #ponylang
Applejack_ has quit [Ping timeout: 244 seconds]
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
jemc has joined #ponylang
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
Applejack_ has joined #ponylang
Applejack_ has quit [Ping timeout: 244 seconds]
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
mrkishi has joined #ponylang
amclain has joined #ponylang
trapped has quit [Read error: Connection reset by peer]
jemc has quit [Quit: WeeChat 1.4]
jemc has joined #ponylang
tm-exa has quit [Quit: Computer has gone to sleep]
hibnico has quit [Quit: hibnico]
runehog_ has quit [Remote host closed the connection]
<Candle>
I have a trait that takes a generic argument, the trait is intended to be implemented by actors as it has a behaviour defined. Currently I have either "this parameter must be sendable" or "can't specify a capability on a type parameter" I don't yet understand the rationale behind the second error message (nor how to resolve the problem)
<Candle>
"trait Foo[E] \n be bar(something: E val)"
tm-exa has joined #ponylang
<SeanTAllen>
specify Foo[Something val]
<SeanTAllen>
but it sounds like what you want is to constrain E to sendable capabilities
<Candle>
Constraining to sendable capabilities sounds like the right solution.
<Candle>
"trait Foo[E val]" gives "syntax error: unterminated type parameters"
tm-exa has quit [Quit: Computer has gone to sleep]
<SeanTAllen>
that's not how you do a constraint Foo[E: Any #send]
<SeanTAllen>
so this trait Foo
<SeanTAllen>
it takes an E
<SeanTAllen>
which can be Any type as long as it is sendable
<felixgallo>
for example -- what is the type of derpa()?
<felixgallo>
from inspection I can see it's Array[(U32 | string)] or some such
<felixgallo>
ponyc --astpackage is not super ultra horrible but requires some arcane decipherage
<felixgallo>
but it'd be nice if I could say, e.g. 'ponyc --what-do-you-think-of derpa'
<SeanTAllen>
actually its None
<SeanTAllen>
the easiest way at the moment is to give it an incorrect value like var l: String = derpa()
<felixgallo>
ahhh yeah
<SeanTAllen>
then you get:
<SeanTAllen>
None val is not a subtype of String val
<felixgallo>
well yes. OK, my example is bad.
<SeanTAllen>
if you put no return type, it defaults to None
<SeanTAllen>
and that's what you will get
<felixgallo>
yeah, I was futzing around trying to get an array literal to be the proper return value for a function of type Array[Any] and got myself turned around.
<felixgallo>
that's the endgame I was trying to get to; being able to assemble a list of arbitrary objects, and then to try to print them out.
<SeanTAllen>
so rather than Array[Any] you want Array[Stringable] right?
<SeanTAllen>
otherwise you can have a runtime kaboom
<felixgallo>
at this stage I don't mind runtime kabooms, although I agree with you wholeheartedly in principle
<felixgallo>
nevertheless Array[Stringable] doesn't work either as the return value of the [] clause is apparently narrowed to [(String val | U32 val)] ref^
<felixgallo>
what I kind of want to do is the quasi-haskell thing: fun derpa() : _ => ["a", 5, 123]
<felixgallo>
I thought fun derpa() : Array[Any] was that, but it turns out that it infers the type of the list and then tries to match against the signature, which continues to bite me conceptually
<felixgallo>
so I guess I misunderstand 'Any' in the pony context. I'd expect that it has every other type as a member. I know it doesn't have tuples which occasionally makes me sad.
<felixgallo>
maybe it's that thing Sylvan was saying, which I flit back and forth between understanding and not understanding, where a type having a constructor makes all the difference.
<felixgallo>
I dunno why I need to be explicit about Stringable like this
<jemc>
felixgallo: regarding Any - more generally, Any can't include any types that we can't do runtime type matching on, which includes tuples (as a whole) and also structs
<jemc>
structs are meant to mirror the C ABI and so cannot have an object header for runtime type matching
<felixgallo>
structs make sense to me in that context
<jemc>
tuples just represent a logical grouping of several types in a sequence - so the grouping itself does not have an object header
<felixgallo>
each element could, on entry, stash its type in a notional tuple header though
<jemc>
so we can match on the types inside the tuple, but we can't match on the tuple itself against other non-tuples or tuples of different element-counts
<SeanTAllen>
Any & Stringable doesn't mean much there... Stringable is all you need
<felixgallo>
yeah. I keep trying to get an Any, for other reasons. But I should probably stop that.