File: ByteString.hs

package info (click to toggle)
haskell-debian 3.64-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 364 kB
  • sloc: haskell: 3,226; ansic: 8; makefile: 3
file content (18 lines) | stat: -rw-r--r-- 491 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{-# OPTIONS -fno-warn-orphans #-}
module Debian.Version.ByteString
    ( ParseDebianVersion(..)
    ) where

import Text.ParserCombinators.Parsec

import qualified Data.ByteString.Char8 as C

import Debian.Version.Common
import Debian.Version.Internal
    
instance ParseDebianVersion C.ByteString where
    parseDebianVersion byteStr =
        let str = C.unpack byteStr in
        case parse parseDV str str of
          Left e -> error (show e)
          Right dv -> DebianVersion str dv