
Recent Posts
Recent Comments
Archives
Categories
Meta
Advertisements
Without covariance (In presence of Invarinace ) class Test[T] var x:Test[Any] = new Test[Nothing] //error doom ,what you see Nothing <: Any, but class Test is invariant in type T. Verbose : Nothing is subclass of Any but … Continue reading
Creating dsl in groovy is easy .For example below dsl is for adding roles and permissions i DSL : And this is code for this dsl to work :
A bit of functional composition and partially implemented function with groovy :
In groovy we could model somewhat similar to Partial functions like in functional languages : First an example with just variable binding in closures With Curry : modelling a partial function :
Append operation in haskell might be costlier ,if done this way let x = “hello” ++ ” haskell” let y = x ++ ” well done ” to append this way have to traverse whole list each time ,a better … Continue reading
This explains foldl in terms of foldr : https://ratndeo.wordpress.com/2013/01/11/haskellfoldlasfoldr/ Now its time to whisper foldr in terms of foldl : foldr :: (a > b > b) > b > [a] > b foldr f init (x:xs) = foldl f’ … Continue reading