<commit_before>module DataConsTypeCons where 
-- : set expandtab ts=2 ruler number spell
-- daw
-- 50 days of Haskell 



data Colour = Red | Green | Blue
{- NOTE! when we ask for Colour's data type we get a "Not in scope" error. 
*DataConsTypeCons> :t Colour 
<interactive>:1:1: Not in scope: data constructor `Colour' 
*DataConsTypeCons> :i Colour 
data Colour = Red | Green | Blue 	-- Defined at 2014-0203ADT.hs:8:6

HOWEVER!
*DataConsTypeCons> :t Red 
Red :: Colour
*DataConsTypeCons> :i Red 
data Colour = Red | ... 	-- Defined at 2014-0203ADT.hs:8:15
-}

 
data Colour' = RGB Int Int Int deriving (Show)  
{- SAME AGAIN 
*DataConsTypeCons> :t Colour' 
<interactive>:1:1: Not in scope: data constructor Colour'
*DataConsTypeCons> :i Colour' 
data Colour' = RGB Int Int Int 	-- Defined at 2014-0203ADT.hs:17:6

*DataConsTypeCons> :t RGB
RGB :: Int -> Int -> Int -> Colour'
-}
data SBTree = Leaf String 
            | Branch String SBTree SBTree

data BTree a = LeAf a 
              | BrAnch a (BTree a) (BTree a) 
<commit_msg>data constructors are NOT types<commit_after>module DataConsTypeCons where 
-- : set expandtab ts=2 ruler number spell
-- daw
-- 50 days of Haskell 
-- A data declaration introduces one or more type constructors and one or more value constructors for each of the type constructors.

-- A data constructor (or value constructor) can have zero or more arguments think of it as, a "function" that takes 0 or more values and gives you back a new value.

-- type constructor may have zero or more arguments, think of it, as a "function" that takes 0 or more types and gives you back a new type.

-- Data constructors are not types, they denote values.


data Colour = Red | Green | Blue
{- NOTE! when we ask for Colour's data type we get a "Not in scope" error. 
*DataConsTypeCons> :t Colour 
<interactive>:1:1: Not in scope: data constructor `Colour' 
*DataConsTypeCons> :i Colour 
data Colour = Red | Green | Blue 	-- Defined at 2014-0203ADT.hs:8:6

HOWEVER!
*DataConsTypeCons> :t Red 
Red :: Colour
*DataConsTypeCons> :i Red 
data Colour = Red | ... 	-- Defined at 2014-0203ADT.hs:8:15
-}

 
data Colour' = RGB Int Int Int deriving (Show)  
{- SAME AGAIN 
*DataConsTypeCons> :t Colour' 
<interactive>:1:1: Not in scope: data constructor Colour'
*DataConsTypeCons> :i Colour' 
data Colour' = RGB Int Int Int 	-- Defined at 2014-0203ADT.hs:17:6

*DataConsTypeCons> :t RGB
RGB :: Int -> Int -> Int -> Colour'
-}
data SBTree = Leaf String 
            | Branch String SBTree SBTree

data BTree a = LeAf a 
              | BrAnch a (BTree a) (BTree a) 
{-
Now we introduce a type variable a as a parameter to the type constructor. In this declaration, BTree has become a function. It takes a type as its argument and it returns a new type.

It is important here to consider the difference between a concrete type (examples include Int, [Char] and Maybe Bool) which is a type that can be assigned to a value in your program, and a type constructor function which you need to feed a type to be able to be assigned to a value. A value can never be of type "list", because it needs to be a "list of something". In the same spirit, a value can never be of type "binary tree", because it needs to be a "binary tree storing something".
-}



{'fraction_non_alphanumeric': 0.08717004297114794, 'fraction_numerical': 0.024554941682013505, 'mean_word_length': 3.415989159891599, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3667951', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1027, 'n_words': 478}