Answering your second message now... On Wed, Jun 22, 2011 at 10:39 AM, Martin Hamant <[email protected]> wrote: >> The type of our function would have to be something like: >> (?mono:bool,source)->(if mono then 1 else 2 end,0,0)source >> In other words the type of the resulting source depends on the value >> that is passed. This is called a dependent type system, but it is far >> too complex for liquidsoap (we would loose type inference and error >> messages would be terrible). > > I know this is not a constructive comment but it looks more natural at first > for the regular user :)
It's not constructive but I love it! If I understand you correctly, you're saying that dependent types feel natural to you. I'm sure most readers won't get it (and won't care) but I take pride in being able to say that we provide non-programmers with a statically typed functional language, and most don't complain because they don't even notice. Now it's only better, you're asking for even more advanced type systems instead of asking for less typing. For sure, you deserve to be part of the team! > Do I have to understand that mono_or_stereo() here returns a new source ? Yes, it returns a new source, which happens to be connected to the one passed in argument. This is what we describe with the tree/graph diagrams on the tutorials: you should not think of modifying a source, but creating another one that feeds from the first and modifies what it gets. > So In my context: > def create_playlist(uri) = > ... I'm not sure what to say here. If you remove the bitrate issue, can you write your function? The bitrate issue is relevant, but I'd like to discuss it later: there are ugly ways to work around it, but we may also be able to find nicer tricks (because the bitrate doesn't change the type of the format like the channels parameter does). See ya, -- David ------------------------------------------------------------------------------ Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Data protection magic? Nope - It's vRanger. Get your free trial download today. http://p.sf.net/sfu/quest-sfdev2dev _______________________________________________ Savonet-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/savonet-users
