package vals

import (
	
)

// Equaler wraps the Equal method.
type Equaler interface {
	// Equal compares the receiver to another value. Two equal values must have
	// the same hash code.
	Equal(other interface{}) bool
}

// Equal returns whether two values are equal. It is implemented for the builtin
// types bool and string, the File, List, Map types, StructMap types, and types
// satisfying the Equaler interface. For other types, it uses reflect.DeepEqual
// to compare the two values.
func (,  interface{}) bool {
	switch x := .(type) {
	case nil:
		return  == 
	case bool:
		return  == 
	case float64:
		return  == 
	case string:
		return  == 
	case Equaler:
		return .Equal()
	case File:
		if ,  := .(File);  {
			return .Fd() == .Fd()
		}
		return false
	case List:
		if ,  := .(List);  {
			return equalList(, )
		}
		return false
	case Map:
		if ,  := .(Map);  {
			return equalMap(, )
		}
		return false
	case StructMap:
		if ,  := .(StructMap);  {
			return equalStructMap(, )
		}
		return false
	default:
		return reflect.DeepEqual(, )
	}
}

func (,  List) bool {
	if .Len() != .Len() {
		return false
	}
	 := .Iterator()
	 := .Iterator()
	for .HasElem() && .HasElem() {
		if !Equal(.Elem(), .Elem()) {
			return false
		}
		.Next()
		.Next()
	}
	return true
}

func (,  Map) bool {
	if .Len() != .Len() {
		return false
	}
	for  := .Iterator(); .HasElem(); .Next() {
		,  := .Elem()
		,  := .Index()
		if ! || !Equal(, ) {
			return false
		}
	}
	return true
}

func (,  StructMap) bool {
	 := reflect.TypeOf()
	if  != reflect.TypeOf() {
		return false
	}

	 := reflect.ValueOf()
	 := reflect.ValueOf()
	 := iterateStructMap()
	for .Next() {
		,  := .Get()
		,  := .Get()
		if !Equal(, ) {
			return false
		}
	}
	return true
}