ObjectName (empty) → 1.0.0.0
raw patch · 4 files changed
+79/−0 lines, 4 filesdep +basesetup-changed
Dependencies added: base
Files
- LICENSE +28/−0
- ObjectName.cabal +18/−0
- Setup.hs +2/−0
- src/Data/ObjectName.hs +31/−0
+ LICENSE view
@@ -0,0 +1,28 @@+Copyright (c) 2009, Sven Panne+All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++1. Redistributions of source code must retain the above copyright notice,+ this list of conditions and the following disclaimer.++2. Redistributions in binary form must reproduce the above copyright+ notice, this list of conditions and the following disclaimer in the+ documentation and/or other materials provided with the distribution.++3. Neither the name of the author nor the names of its contributors may be+ used to endorse or promote products derived from this software without+ specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE+POSSIBILITY OF SUCH DAMAGE.
+ ObjectName.cabal view
@@ -0,0 +1,18 @@+name: ObjectName+version: 1.0.0.0+license: BSD3+license-file: LICENSE+maintainer: Sven Panne <sven.panne@aedion.de>+bug-reports: mailto:hopengl@haskell.org+homepage: http://www.haskell.org/HOpenGL/+category: Data+synopsis: Explicitly handled object names+description:+ This tiny package contains the class ObjectName, which corresponds to the+ general notion of explicitly handled identifiers for API objects, e.g. a+ texture object name in OpenGL or a buffer object name in OpenAL.+build-type: Simple+exposed-modules: Data.ObjectName+hs-Source-Dirs: src+ghc-options: -Wall+build-depends: base >= 3 && < 5
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ src/Data/ObjectName.hs view
@@ -0,0 +1,31 @@+--------------------------------------------------------------------------------+-- |+-- Module : Data.ObjectName+-- Copyright : (c) Sven Panne 2009+-- License : BSD-style (see the file LICENSE)+-- +-- Maintainer : sven.panne@aedion.de+-- Stability : stable+-- Portability : portable+--+-- Object names are explicitly handled identifiers for API objects, e.g. a+-- texture object name in OpenGL or a buffer object name in OpenAL.+--+--------------------------------------------------------------------------------++module Data.ObjectName ( ObjectName(..) ) where++-- | An 'ObjectName' is an explicitly handled identifier for API objects, e.g. a+-- texture object name in OpenGL or a buffer object name in OpenAL.++class ObjectName a where+ -- | Generate a given number of object names, which are guaranteed to be+ -- unused. By generating the names, they become used.+ genObjectNames :: Int -> IO [a]++ -- | Make the given object names available again, declaring them as unused.+ deleteObjectNames:: [a] -> IO ()++ -- | Test if the given object name is currently in use, i.e. test if it has+ -- been generated, but not been deleted so far.+ isObjectName :: a -> IO Bool