File: BenchWindowsString.hs

package info (click to toggle)
haskell-os-string 2.0.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 332 kB
  • sloc: haskell: 3,283; makefile: 3
file content (34 lines) | stat: -rw-r--r-- 947 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{-# LANGUAGE CPP #-}
{-# LANGUAGE BangPatterns        #-}
{-# LANGUAGE PackageImports      #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE MagicHash           #-}
{-# LANGUAGE OverloadedStrings   #-}
{-# LANGUAGE QuasiQuotes         #-}
{-# LANGUAGE TypeApplications    #-}

#define OSSTR pstr
#define OS_STRING WindowsString
#define OS_CHAR WindowsChar


module BenchWindowsString (benchMark) where

import           System.OsString.Windows               (WindowsString, WindowsChar, pstr)
import qualified System.OsString.Windows               as S
import           System.OsString.Internal.Types        (WindowsChar(..))

#include "Common.hs"

benchStr :: String
benchStr = "WindowsString"

w :: Int -> WindowsChar
w i = WindowsChar (fromIntegral i)

hashWord8 :: WindowsChar -> WindowsChar
hashWord8 (WindowsChar w) = WindowsChar . fromIntegral . hashInt . fromIntegral $ w

iw :: WindowsChar -> Int
iw (WindowsChar w) = fromIntegral w