<commit_before>module Convention
  ( Signature(..)
  ) where

import Data.ByteString.Builder
import Test.QuickCheck


-- |Datatype for function arguments: integers of different sizes and a pointer type
data ArgumentType
  = I8
  | I16
  | I32
  | I64
  | Pointer
  deriving (Eq, Enum, Bounded, Ord, Show)

-- |C syntax for data type
cType :: ArgumentType -> Builder
cType t = case t of
  I8      -> string8 "unsigned char"
  I16     -> string8 "unsigned short"
  I32     -> string8 "unsigned int"
  I64     -> string8 "unsigned long long"
  Pointer -> string8 "void *"

-- |Size of data types in bytes
byteSize :: ArgumentType -> Int
byteSize t = case t of
  I8      -> 1
  I16     -> 2
  I32     -> 4
  I64     -> 8<commit_msg>Add module for function signatures<commit_after>module Convention
  ( Signature(..)
  ) where

import Data.ByteString.Builder
import Test.QuickCheck


-- |Datatype for function arguments: integers of different sizes and a pointer type
data ArgumentType
  = I8
  | I16
  | I32
  | I64
  | Pointer
  deriving (Eq, Enum, Bounded, Ord, Show)

-- |C syntax for data type
printArgumentType :: ArgumentType -> Builder
printArgumentType t = case t of
  I8      -> string8 "unsigned char"
  I16     -> string8 "unsigned short"
  I32     -> string8 "unsigned int"
  I64     -> string8 "unsigned long long"
  Pointer -> string8 "void *"

-- |Size of data types in bytes
byteSize :: ArgumentType -> Int
byteSize t = case t of
  I8      -> 1
  I16     -> 2
  I32     -> 4
  I64     -> 8
{'fraction_non_alphanumeric': 0.09593604263824117, 'fraction_numerical': 0.039973351099267154, 'mean_word_length': 2.5676959619952493, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, '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': '6228213', 'n_tokens_mistral': 512, 'n_tokens_neox': 476, 'n_words': 179}