What kind of object x is above. If Maybe is a parameterized data type, then x is ~something~ type, not sure.
You can not construct a Maybe 10, you can for example construct a Just 10. In case 10 is here an Int (well technically it can be any numerical type, but let us ignore that for now), then you constructed a Maybe Int.
Note that a in Maybe a, is one meta level higher: it works with types. Hence a is a type parameter. It thus does not take as value 10, but for example Int.
What you can do however is define a type alias for Maybe Int, for example:
type X = Maybe Int
Note that we here use type as a type alias, not data to construct a data type.
Types (and type aliasses) always start with an upper case, so we can not define a type x, only a type X. A type has no default constructor (which is typically the case in OO programming languages).
How to create an instance of x.
Haskell can derive the most generic type of an expression itself. We thus write an expression that has the type of Maybe Int, so for example
Just 10
In case the type would be too generic (here it will be Num a => Maybe a), we can give a hint to Haskell by using two consecutive colons (::), for eample:
Just 10 :: Maybe Int
or since we already introduced the type alias X:
Just 10 :: X
What is the instance of x for Maybe, since we passed it 10. Wondering, if the instance value is 10 and has type Int.
Welll as said before, types in Haskell have no default constructor. We here have two candidates: Just n with n an Int (in case we use type X), or Nothing. So we pick one of the two:
Just 10 :: X
Nothing :: X
Since you can not change the state of an object anymore after you constructed it (i.e. all objects in Haskell are immutable), that means that it would be strange that a default constructor sets some initial data, and then later methods would change that object.
You can therefore see a data constructor (here Just and Nothing) as a labelled container that holds a group of parameters together in a container, and labels it with what constructor was used. So a graphical view of the objects would be:
+------+ +---------+
| Just | | Nothing |
+------+ +---------+
| o |
+---|--+
|
v
+----+
| 10 |
+----+
newis only used to allocate objects on the heap, etc. It is thus some sort of "malloc", if you allocate on the stack, then you typically do not usenew.myinstance, or another value, does not matter, since you later can not alter the attributes of the element.