Sha256: 7e253574b090225458ccbb49ef9ac45e6764b9d81f1c9e68ba494727a4ac7319

Contents?: true

Size: 381 Bytes

Versions: 214

Compression:

Stored size: 381 Bytes

Contents

module Hamming

import Data.Vect

public export
data Nucleotide = A | C | G | T

public export
implementation Eq Nucleotide where
  A == A = True
  C == C = True
  G == G = True
  T == T = True
  _ == _ = False

export
hamming_distance : Eq a => Vect n a -> Vect n a -> Nat
hamming_distance s1 s2 = 
  fst $ filter ((/=) 0) $ map (\(n1,n2) => if n1 == n2 then 0 else 1) $ zip s1 s2

Version data entries

214 entries across 214 versions & 1 rubygems

Version Path
trackler-2.2.1.100 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.99 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.98 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.97 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.96 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.95 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.94 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.93 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.92 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.91 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.90 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.89 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.88 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.87 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.86 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.85 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.84 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.83 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.82 tracks/idris/exercises/hamming/src/example.idr
trackler-2.2.1.81 tracks/idris/exercises/hamming/src/example.idr