typeclass
Scala: Do implicit conversions work on Any?
I would like to store some objects from different type hierarchy into List[Any] or similar container, but perform implicit conversions on th开发者_Python百科em later on to do something like type class[详细]
2023-01-18 07:34 分类:问答alternative to typeclasses?
haskell programmer. using F#. no typeclasses in F#. what to use when I need t开发者_运维知识库ypeclasses?Do check out this as someone suggested.[详细]
2023-01-15 00:21 分类:问答In Haskell, why isn't there a TypeClass for things that can act like lists?
I\'m reading Learn You a Haskell and I\'m wondering why so many things are acting like a list, and nothing in the Pr开发者_Go百科elude is using the native facility of type classes to set this up:[详细]
2023-01-14 07:04 分类:问答List of custom type and instance of class
I\'m playing around in Haskell to try and get the hang of it. I\'m running into problems with my typeclasses. What I\'m trying to do is to make a generalized a* module by defining classes and methods[详细]
2023-01-10 17:53 分类:问答Automatic conversion of types for FFI calls in Haskell
I have defined the f开发者_如何学运维ollowing module to help me with FFI function export: {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, TypeSynonymInstances #-}[详细]
2023-01-09 03:47 分类:问答Writing a function with a universally-quantified return type
If I write foo :: (Num a) => a foo = 42 GHC happily accepts it, but if I write bar :: (Num a) => a bar = (42 :: Int)[详细]
2023-01-08 03:49 分类:问答What is context in Haskell multiparameter type class
In chapter 15 of Rea开发者_如何学Pythonl World Haskell, a type class is defined: class (Monad m) => MonadSupply s m | m -> s where[详细]
2023-01-07 23:13 分类:问答deducing type of multi-parameter type class
I\'m trying to get the following code to compile import IO data MyInt = MyInt Int data MyString = MyString String deriving Show[详细]
2023-01-07 14:38 分类:问答Haskell typeclass inheritance and parametric typeclass
I wish to say开发者_StackOverflow that a certain parametrized monad st works with a regular memory, but a subclass of my parametrized monad should impose an additional constraint on the type of memory[详细]
2023-01-07 14:16 分类:问答How do typeclasses and modules interact?
In order to grasp better typeclasses (starting pretty much form scratch) I had a go at modelling 2-D shapes with area calculations, like this:[详细]
2023-01-07 10:48 分类:问答