<commit_before>{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}

module SizeOf where

import Ivory.Language

[ivory|

struct foo
  { f1 :: Stored Uint8
  ; f2 :: Stored Uint32
  }

|]


test :: Def ('[] :-> Uint8)
test  = proc "test" (body (ret (sizeOf (Proxy :: Proxy (Struct "foo")))))

cmodule :: Module
cmodule  = package "SizeOf" $ do
  defStruct (Proxy :: Proxy "foo")
  incl test<commit_msg>ivory examples: add no-warn-orphans pragma.<commit_after>{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}

{-# OPTIONS_GHC -fno-warn-orphans #-}

module SizeOf where

import Ivory.Language

[ivory|

struct foo
  { f1 :: Stored Uint8
  ; f2 :: Stored Uint32
  }

|]


test :: Def ('[] :-> Uint8)
test  = proc "test" (body (ret (sizeOf (Proxy :: Proxy (Struct "foo")))))

cmodule :: Module
cmodule  = package "SizeOf" $ do
  defStruct (Proxy :: Proxy "foo")
  incl test
{'fraction_non_alphanumeric': 0.1671612265084075, 'fraction_numerical': 0.011869436201780416, 'mean_word_length': 3.685185185185185, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2470382', 'n_tokens_mistral': 412, 'n_tokens_neox': 406, 'n_words': 101}